Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
* [#597](https://github.com/slack-ruby/slack-ruby-client/pull/597): Add AgentsSessions and AppsManagedPermissions endpoint modules for agents.sessions and apps.managedPermissions methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#597](https://github.com/slack-ruby/slack-ruby-client/pull/597): Increase conversations.invite users limit from 100 to 1000 - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#597](https://github.com/slack-ruby/slack-ruby-client/pull/597): Add new Slack API error codes - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add channel_ids argument to admin.apps.permissions.add and admin.apps.permissions.remove, and channel_ids/channel_restriction_mode to admin.apps.permissions.set - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add oauth.v2.beginShortTokenRotation and oauth.v2.completeShortTokenRotation methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add session_status argument to chat.stopStream - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add include_list argument to slackLists.items.list - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add new error codes including channel_restriction_requires_app_access, channel_restrictions_not_available, rotation_not_found, token_too_long, user_is_external_guest, and user_not_authenticated - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* Your contribution here.

### 3.2.0 (2026/07/05)
Expand Down
4 changes: 4 additions & 0 deletions bin/commands/admin_apps_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class App
c.flag 'app_id', desc: 'Encoded ID of the app.'
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
c.flag 'channel_ids', desc: "List of encoded channel IDs to add to the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method."
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_apps_permissions_add(options))
end
Expand All @@ -32,6 +33,7 @@ class App
c.flag 'app_id', desc: 'Encoded ID of the app.'
c.flag 'user_ids', desc: 'List of user IDs whose named_entities access will be revoked.'
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
c.flag 'channel_ids', desc: "List of encoded channel IDs to remove from the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method."
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_apps_permissions_remove(options))
end
Expand All @@ -44,6 +46,8 @@ class App
c.flag 'permission_type', desc: 'The type of permission that defines who can access the app.'
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
c.flag 'channel_restriction_mode', desc: 'The mode that defines where the app can be used in channels.'
c.flag 'channel_ids', desc: 'List of encoded channel IDs for channel restrictions. Semantics depend on channel_restriction_mode: allowlist for specific_channels, exclusion list for all_channels_except.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_apps_permissions_set(options))
end
Expand Down
5 changes: 3 additions & 2 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class App
g.long_desc %( Starts a new streaming conversation. )
g.command 'startStream' do |c|
c.flag 'channel', desc: 'An encoded ID that represents a channel, thread, or DM.'
c.flag 'chunks', desc: 'Array of streaming chunks.'
c.flag 'chunks', desc: 'Array of streaming chunks. Can include markdown text chunk objects, task update chunk objects, plan update chunks, or blocks chunks.'
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters.'
c.flag 'thread_ts', desc: "Provide another message's ts value to reply to. Omit it to stream a top-level message instead of a thread reply; this is only supported in channels where the whole channel is one session, such as Slack Code, and returns invalid_thread_ts elsewhere. Passing '0' is equivalent to omitting it."
c.flag 'recipient_user_id', desc: 'The encoded ID of the user to receive the streaming text. Required when streaming to channels.'
Expand All @@ -164,11 +164,12 @@ class App
g.long_desc %( Stops a streaming conversation. )
g.command 'stopStream' do |c|
c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or DM.'
c.flag 'chunks', desc: 'Array of streaming chunks.'
c.flag 'chunks', desc: 'Array of streaming chunks. Can include markdown text chunk objects, task update chunk objects, plan update chunks, or blocks chunks.'
c.flag 'ts', desc: 'The timestamp of the streaming message.'
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters.'
c.flag 'blocks', desc: 'A list of blocks that will be rendered at the bottom of the finalized message.'
c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
c.flag 'session_status', desc: 'The session status to set after stopping the stream.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.chat_stopStream(options))
end
Expand Down
21 changes: 21 additions & 0 deletions bin/commands/oauth_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ class App
end
end

g.desc 'Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change.'
g.long_desc %( Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. )
g.command 'beginShortTokenRotation' do |c|
c.flag 'client_id', desc: 'Issued when you created your application. Must be the app the token being rotated was issued to.'
c.flag 'client_secret', desc: 'Issued when you created your application.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.oauth_v2_beginShortTokenRotation(options))
end
end

g.desc 'Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process.'
g.long_desc %( Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. )
g.command 'completeShortTokenRotation' do |c|
c.flag 'client_id', desc: 'Issued when you created your application. Must be the app the token being rotated was issued to.'
c.flag 'client_secret', desc: 'Issued when you created your application.'
c.flag 'new_token', desc: 'The new xoxp token returned by oauth.v2.beginShortTokenRotation.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.oauth_v2_completeShortTokenRotation(options))
end
end

g.desc 'Exchanges a legacy access token for a new expiring access token and refresh token'
g.long_desc %( Exchanges a legacy access token for a new expiring access token and refresh token )
g.command 'exchange' do |c|
Expand Down
1 change: 1 addition & 0 deletions bin/commands/slackLists_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class App
c.flag 'limit', desc: 'The maximum number of records to return.'
c.flag 'cursor', desc: 'Next cursor for pagination.'
c.flag 'archived', desc: 'Boolean indicating whether archived items or normal items should be returned.'
c.flag 'include_list', desc: 'Set to true to also return the parent list object, including its title, column schema, and total row count. Defaults to false to keep the response small.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.slackLists_items_list(options))
end
Expand Down
8 changes: 8 additions & 0 deletions lib/slack/web/api/endpoints/admin_apps_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module AdminAppsPermissions
# List of user IDs to allow for named_entities visibility.
# @option options [array] :usergroup_ids
# List of encoded usergroup IDs.
# @option options [array] :channel_ids
# List of encoded channel IDs to add to the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method.
# @see https://api.slack.com/methods/admin.apps.permissions.add
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.permissions/admin.apps.permissions.add.json
def admin_apps_permissions_add(options = {})
Expand Down Expand Up @@ -43,6 +45,8 @@ def admin_apps_permissions_list(options = {})
# List of user IDs whose named_entities access will be revoked.
# @option options [array] :usergroup_ids
# List of encoded usergroup IDs.
# @option options [array] :channel_ids
# List of encoded channel IDs to remove from the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method.
# @see https://api.slack.com/methods/admin.apps.permissions.remove
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.permissions/admin.apps.permissions.remove.json
def admin_apps_permissions_remove(options = {})
Expand All @@ -61,6 +65,10 @@ def admin_apps_permissions_remove(options = {})
# List of user IDs to allow for named_entities visibility.
# @option options [array] :usergroup_ids
# List of encoded usergroup IDs.
# @option options [enum] :channel_restriction_mode
# The mode that defines where the app can be used in channels.
# @option options [array] :channel_ids
# List of encoded channel IDs for channel restrictions. Semantics depend on channel_restriction_mode: allowlist for specific_channels, exclusion list for all_channels_except.
# @see https://api.slack.com/methods/admin.apps.permissions.set
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.permissions/admin.apps.permissions.set.json
def admin_apps_permissions_set(options = {})
Expand Down
6 changes: 4 additions & 2 deletions lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def chat_scheduleMessage(options = {})
# @option options [channel] :channel
# An encoded ID that represents a channel, thread, or DM.
# @option options [array] :chunks
# Array of streaming chunks.
# Array of streaming chunks. Can include markdown text chunk objects, task update chunk objects, plan update chunks, or blocks chunks.
# @option options [string] :markdown_text
# Accepts message text formatted in markdown. Limit this field to 12,000 characters.
# @option options [string] :thread_ts
Expand Down Expand Up @@ -284,7 +284,7 @@ def chat_startStream(options = {})
# @option options [channel] :channel
# An encoded ID that represents a channel, private group, or DM.
# @option options [array] :chunks
# Array of streaming chunks.
# Array of streaming chunks. Can include markdown text chunk objects, task update chunk objects, plan update chunks, or blocks chunks.
# @option options [timestamp] :ts
# The timestamp of the streaming message.
# @option options [string] :markdown_text
Expand All @@ -293,6 +293,8 @@ def chat_startStream(options = {})
# A list of blocks that will be rendered at the bottom of the finalized message.
# @option options [string] :metadata
# JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
# @option options [enum] :session_status
# The session status to set after stopping the stream.
# @see https://api.slack.com/methods/chat.stopStream
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.stopStream.json
def chat_stopStream(options = {})
Expand Down
33 changes: 33 additions & 0 deletions lib/slack/web/api/endpoints/oauth_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,39 @@ def oauth_v2_access(options = {})
post('oauth.v2.access', options)
end

#
# Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change.
#
# @option options [string] :client_id
# Issued when you created your application. Must be the app the token being rotated was issued to.
# @option options [string] :client_secret
# Issued when you created your application.
# @see https://api.slack.com/methods/oauth.v2.beginShortTokenRotation
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth.v2/oauth.v2.beginShortTokenRotation.json
def oauth_v2_beginShortTokenRotation(options = {})
raise ArgumentError, 'Required arguments :client_id missing' if options[:client_id].nil?
raise ArgumentError, 'Required arguments :client_secret missing' if options[:client_secret].nil?
post('oauth.v2.beginShortTokenRotation', options)
end

#
# Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process.
#
# @option options [string] :client_id
# Issued when you created your application. Must be the app the token being rotated was issued to.
# @option options [string] :client_secret
# Issued when you created your application.
# @option options [string] :new_token
# The new xoxp token returned by oauth.v2.beginShortTokenRotation.
# @see https://api.slack.com/methods/oauth.v2.completeShortTokenRotation
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth.v2/oauth.v2.completeShortTokenRotation.json
def oauth_v2_completeShortTokenRotation(options = {})
raise ArgumentError, 'Required arguments :client_id missing' if options[:client_id].nil?
raise ArgumentError, 'Required arguments :client_secret missing' if options[:client_secret].nil?
raise ArgumentError, 'Required arguments :new_token missing' if options[:new_token].nil?
post('oauth.v2.completeShortTokenRotation', options)
end

#
# Exchanges a legacy access token for a new expiring access token and refresh token
#
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints/slackLists_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def slackLists_items_info(options = {})
# Next cursor for pagination.
# @option options [boolean] :archived
# Boolean indicating whether archived items or normal items should be returned.
# @option options [boolean] :include_list
# Set to true to also return the parent list object, including its title, column schema, and total row count. Defaults to false to keep the response small.
# @see https://api.slack.com/methods/slackLists.items.list
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/slackLists.items/slackLists.items.list.json
def slackLists_items_list(options = {})
Expand Down
Loading