Skip to content

Commit

Permalink
Update API from slack-api-ref@1ee282e (2025-02-28)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Feb 28, 2025
1 parent f2423d4 commit ac18a83
Show file tree
Hide file tree
Showing 15 changed files with 111 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 2.5.3 (Next)

* [#549](https://github.com/slack-ruby/slack-ruby-client/pull/549): Add group ID formatting support for message mentions - [@n0h0](https://github.com/n0h0).
* [#547](https://github.com/slack-ruby/slack-ruby-client/pull/547): Update API from [slack-api-ref@1ee282e](https://github.com/slack-ruby/slack-api-ref/commit/1ee282e) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* Your contribution here.

### 2.5.2 (2025/02/19)
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/admin_conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class App
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
c.flag 'target_team_ids', desc: 'A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.'
c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
c.flag 'team_id', desc: 'The workspace to which the channel belongs if the channel is a local workspace channel. Omit this argument if the channel is a cross-workspace or org-wide shared channel.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_conversations_setTeams(options))
end
Expand Down
27 changes: 27 additions & 0 deletions bin/commands/assistant_search.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'AssistantSearch methods.'
command 'assistant_search' do |g|
g.desc 'Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval.'
g.long_desc %( Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval. )
g.command 'context' do |c|
c.flag 'query', desc: 'User prompt or search query.'
c.flag 'action_token', desc: 'Send action_token as received in a message event.'
c.flag 'channel_types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
c.flag 'content_types', desc: 'Content types to include, a comma-separated list of any combination of messages, files.'
c.flag 'context_channel_id', desc: 'Context channel ID to support scoping the search when applicable.'
c.flag 'cursor', desc: 'The cursor returned by the API. Leave this blank for the first request, and use this to get the next page of results.'
c.flag 'include_bots', desc: 'If you want the results to include bots.'
c.flag 'limit', desc: 'Number of results to return, up to a max of 20. Defaults to 20.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.assistant_search_context(options))
end
end
end
end
end
end
10 changes: 6 additions & 4 deletions bin/commands/functions_distributions_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class App
end
end

g.desc 'List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities'
g.long_desc %( List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities )
g.desc 'List the access type of a custom slack function and include the users or team or org ids with access if its permission_type is set to named_entities'
g.long_desc %( List the access type of a custom slack function and include the users or team or org ids with access if its permission_type is set to named_entities )
g.command 'list' do |c|
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
Expand All @@ -41,13 +41,15 @@ class App
end
end

g.desc 'Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities'
g.long_desc %( Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities )
g.desc 'Set the access type of a custom slack function and define the users or team or org ids to be granted access if permission_type is set to named_entities'
g.long_desc %( Set the access type of a custom slack function and define the users or team or org ids to be granted access if permission_type is set to named_entities )
g.command 'set' do |c|
c.flag 'permission_type', desc: 'The type of permission that defines how the function can be distributed.'
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
c.flag 'function_id', desc: 'The encoded ID of the function.'
c.flag 'org_ids', desc: 'List of org IDs to allow for named_entities permission.'
c.flag 'team_ids', desc: 'List of team IDs to allow for named_entities permission.'
c.flag 'user_ids', desc: 'List of encoded user IDs.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_distributions_permissions_set(options))
Expand Down
1 change: 0 additions & 1 deletion bin/commands/usergroups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class App
c.flag 'include_disabled', desc: 'Include disabled User Groups.'
c.flag 'include_users', desc: 'Include the list of users for each User Group.'
c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.'
c.flag 'usergroup_id', desc: 'The id of the usergroup you would like to filter the results down to.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.usergroups_list(options))
end
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
require_relative 'endpoints/apps_datastore'
require_relative 'endpoints/apps_event_authorizations'
require_relative 'endpoints/apps_manifest'
require_relative 'endpoints/assistant_search'
require_relative 'endpoints/assistant_threads'
require_relative 'endpoints/auth'
require_relative 'endpoints/auth_teams'
Expand Down Expand Up @@ -141,6 +142,7 @@ module Endpoints
include AppsDatastore
include AppsEventAuthorizations
include AppsManifest
include AssistantSearch
include AssistantThreads
include Auth
include AuthTeams
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def admin_conversations_setCustomRetention(options = {})
# @option options [array] :target_team_ids
# A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.
# @option options [Object] :team_id
# The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.
# The workspace to which the channel belongs if the channel is a local workspace channel. Omit this argument if the channel is a cross-workspace or org-wide shared channel.
# @see https://api.slack.com/methods/admin.conversations.setTeams
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setTeams.json
def admin_conversations_setTeams(options = {})
Expand Down
44 changes: 44 additions & 0 deletions lib/slack/web/api/endpoints/assistant_search.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module AssistantSearch
#
# Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval.
#
# @option options [string] :query
# User prompt or search query.
# @option options [string] :action_token
# Send action_token as received in a message event.
# @option options [array] :channel_types
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
# @option options [array] :content_types
# Content types to include, a comma-separated list of any combination of messages, files.
# @option options [Object] :context_channel_id
# Context channel ID to support scoping the search when applicable.
# @option options [string] :cursor
# The cursor returned by the API. Leave this blank for the first request, and use this to get the next page of results.
# @option options [boolean] :include_bots
# If you want the results to include bots.
# @option options [integer] :limit
# Number of results to return, up to a max of 20. Defaults to 20.
# @see https://api.slack.com/methods/assistant.search.context
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.search/assistant.search.context.json
def assistant_search_context(options = {})
raise ArgumentError, 'Required arguments :query missing' if options[:query].nil?
if block_given?
Pagination::Cursor.new(self, :assistant_search_context, options).each do |page|
yield page
end
else
post('assistant.search.context', options)
end
end
end
end
end
end
end
1 change: 0 additions & 1 deletion lib/slack/web/api/endpoints/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def conversations_join(options = {})
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.kick.json
def conversations_kick(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
post('conversations.kick', options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def functions_distributions_permissions_add(options = {})
end

#
# List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities
# List the access type of a custom slack function and include the users or team or org ids with access if its permission_type is set to named_entities
#
# @option options [string] :function_app_id
# The encoded ID of the app.
Expand Down Expand Up @@ -56,7 +56,7 @@ def functions_distributions_permissions_remove(options = {})
end

#
# Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities
# Set the access type of a custom slack function and define the users or team or org ids to be granted access if permission_type is set to named_entities
#
# @option options [enum] :permission_type
# The type of permission that defines how the function can be distributed.
Expand All @@ -66,6 +66,10 @@ def functions_distributions_permissions_remove(options = {})
# The callback ID defined in the function's definition file.
# @option options [string] :function_id
# The encoded ID of the function.
# @option options [array] :org_ids
# List of org IDs to allow for named_entities permission.
# @option options [array] :team_ids
# List of team IDs to allow for named_entities permission.
# @option options [array] :user_ids
# List of encoded user IDs.
# @see https://api.slack.com/methods/functions.distributions.permissions.set
Expand Down
2 changes: 0 additions & 2 deletions lib/slack/web/api/endpoints/usergroups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ def usergroups_enable(options = {})
# Include the list of users for each User Group.
# @option options [string] :team_id
# encoded team id to list user groups in, required if org token is used.
# @option options [Object] :usergroup_id
# The id of the usergroup you would like to filter the results down to.
# @see https://api.slack.com/methods/usergroups.list
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
def usergroups_list(options = {})
Expand Down
8 changes: 8 additions & 0 deletions lib/slack/web/api/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class ConnectedTeamPassedInIsNotTopLevelTeam < SlackError; end
class ConnectedUserDenied < SlackError; end
class ConnectionLimitExceeded < SlackError; end
class ConnectionLimitExceededPending < SlackError; end
class ContextChannelNotFound < SlackError; end
class CouldNotArchiveChannel < SlackError; end
class CouldNotConvertChannel < SlackError; end
class CouldNotCreateChannel < SlackError; end
Expand Down Expand Up @@ -272,6 +273,7 @@ class IncludeDeactivatedUserWorkspacesInvalid < SlackError; end
class InsecureRequest < SlackError; end
class InternalError < SlackError; end
class InvalidAction < SlackError; end
class InvalidActionToken < SlackError; end
class InvalidActor < SlackError; end
class InvalidApp < SlackError; end
class InvalidAppActionType < SlackError; end
Expand Down Expand Up @@ -427,6 +429,7 @@ class MissingDuration < SlackError; end
class MissingFileData < SlackError; end
class MissingPostType < SlackError; end
class MissingProfileId < SlackError; end
class MissingQuery < SlackError; end
class MissingResource < SlackError; end
class MissingScope < SlackError; end
class MissingSource < SlackError; end
Expand Down Expand Up @@ -539,6 +542,7 @@ class ProvidersNotFound < SlackError; end
class PublicVideoNotAllowed < SlackError; end
class PublishedAppOnly < SlackError; end
class PushLimitReached < SlackError; end
class QueryTooLong < SlackError; end
class RateLimited < SlackError; end
class Ratelimit < SlackError; end
class Ratelimited < SlackError; end
Expand Down Expand Up @@ -814,6 +818,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'connected_user_denied' => ConnectedUserDenied,
'connection_limit_exceeded' => ConnectionLimitExceeded,
'connection_limit_exceeded_pending' => ConnectionLimitExceededPending,
'context_channel_not_found' => ContextChannelNotFound,
'could_not_archive_channel' => CouldNotArchiveChannel,
'could_not_convert_channel' => CouldNotConvertChannel,
'could_not_create_channel' => CouldNotCreateChannel,
Expand Down Expand Up @@ -949,6 +954,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'insecure_request' => InsecureRequest,
'internal_error' => InternalError,
'invalid_action' => InvalidAction,
'invalid_action_token' => InvalidActionToken,
'invalid_actor' => InvalidActor,
'invalid_app' => InvalidApp,
'invalid_app_action_type' => InvalidAppActionType,
Expand Down Expand Up @@ -1104,6 +1110,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'missing_file_data' => MissingFileData,
'missing_post_type' => MissingPostType,
'missing_profile_id' => MissingProfileId,
'missing_query' => MissingQuery,
'missing_resource' => MissingResource,
'missing_scope' => MissingScope,
'missing_source' => MissingSource,
Expand Down Expand Up @@ -1216,6 +1223,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'public_video_not_allowed' => PublicVideoNotAllowed,
'published_app_only' => PublishedAppOnly,
'push_limit_reached' => PushLimitReached,
'query_too_long' => QueryTooLong,
'rate_limited' => RateLimited,
'ratelimit' => Ratelimit,
'ratelimited' => Ratelimited,
Expand Down
13 changes: 13 additions & 0 deletions spec/slack/web/api/endpoints/assistant_search_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

require 'spec_helper'

RSpec.describe Slack::Web::Api::Endpoints::AssistantSearch do
let(:client) { Slack::Web::Client.new }
context 'assistant.search_context' do
it 'requires query' do
expect { client.assistant_search_context }.to raise_error ArgumentError, /Required arguments :query missing/
end
end
end
5 changes: 1 addition & 4 deletions spec/slack/web/api/endpoints/conversations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@
end
context 'conversations_kick' do
it 'requires channel' do
expect { client.conversations_kick(user: %q[W1234567890]) }.to raise_error ArgumentError, /Required arguments :channel missing/
end
it 'requires user' do
expect { client.conversations_kick(channel: %q[C1234567890]) }.to raise_error ArgumentError, /Required arguments :user missing/
expect { client.conversations_kick }.to raise_error ArgumentError, /Required arguments :channel missing/
end
end
context 'conversations_leave' do
Expand Down

0 comments on commit ac18a83

Please sign in to comment.