diff --git a/CHANGELOG.md b/CHANGELOG.md index 749b4cfc..0e306ff0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ * [#591](https://github.com/slack-ruby/slack-ruby-client/pull/591): Generate AI CHANGELOG entries and PR summaries for automated API update PRs, lock simplecov below 1.1.0 to avoid breaking Coveralls - [@dblock](https://github.com/dblock). * [#592](https://github.com/slack-ruby/slack-ruby-client/pull/592): Fix a YAML indentation bug in AI CHANGELOG entry generation that broke the automated API update workflow - [@dblock](https://github.com/dblock). * [#593](https://github.com/slack-ruby/slack-ruby-client/pull/593): Migrate AI CHANGELOG entry generation to Copilot CLI after GitHub Models retirement - [@dblock](https://github.com/dblock). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add entity.acknowledgeCommentAction and entity.presentComments methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add admin.apps.mcpServers, admin.apps.mcpServers.permissions, and admin.apps.permissions endpoints - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add a metadata argument to chat.postEphemeral - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Remove required :url validation from admin.emoji.add - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add username, icon_url, and icon_emoji arguments to files.completeUploadExternal - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add format, include_threads, and include_attachments arguments to slackLists.download.start and slackLists.download.get - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add exclude_muted argument to users.conversations - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add new error codes to errors.rb and update slack-api-ref submodule - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * Your contribution here. ### 3.2.0 (2026/07/05) diff --git a/bin/commands/admin_apps_mcp_servers.rb b/bin/commands/admin_apps_mcp_servers.rb new file mode 100644 index 00000000..17a7346c --- /dev/null +++ b/bin/commands/admin_apps_mcp_servers.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'AdminAppsMcpServers methods.' + command 'admin_apps_mcp_servers' do |g| + g.desc "List third-party app MCP servers approved for an organization, derived from the org's MCP server allowlist. Entries reflect allowlist state, not install/scope liveness: servers of apps that are uninstalled (but not deleted) are still listed." + g.long_desc %( List third-party app MCP servers approved for an organization, derived from the org's MCP server allowlist. Entries reflect allowlist state, not install/scope liveness: servers of apps that are uninstalled (but not deleted) are still listed. ) + g.command 'list' do |c| + c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.' + c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_apps_mcp_servers_list(options)) + end + end + end + end + end +end diff --git a/bin/commands/admin_apps_mcp_servers_permissions.rb b/bin/commands/admin_apps_mcp_servers_permissions.rb new file mode 100644 index 00000000..8f4eb062 --- /dev/null +++ b/bin/commands/admin_apps_mcp_servers_permissions.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'AdminAppsMcpServersPermissions methods.' + command 'admin_apps_mcp_servers_permissions' do |g| + g.desc 'List MCP servers for an app with their access control permissions' + g.long_desc %( List MCP servers for an app with their access control permissions ) + g.command 'list' do |c| + c.flag 'app_id', desc: 'Encoded ID of the app.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_apps_mcp_servers_permissions_list(options)) + end + end + + g.desc 'Set the access control permission for who can use an MCP server' + g.long_desc %( Set the access control permission for who can use an MCP server ) + g.command 'set' do |c| + c.flag 'app_id', desc: 'Encoded ID of the app.' + c.flag 'server_id', desc: 'Encoded ID of the MCP server.' + c.flag 'permission_type', desc: 'The type of permission that defines who can use this MCP server.' + c.flag 'user_ids', desc: 'List of user IDs to set for named_entities or named_entities_exclude.' + c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_apps_mcp_servers_permissions_set(options)) + end + end + end + end + end +end diff --git a/bin/commands/admin_apps_permissions.rb b/bin/commands/admin_apps_permissions.rb new file mode 100644 index 00000000..ada87300 --- /dev/null +++ b/bin/commands/admin_apps_permissions.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'AdminAppsPermissions methods.' + command 'admin_apps_permissions' do |g| + g.desc 'Grant permission for entities to access an app that has its permission type set to named_entities' + g.long_desc %( Grant permission for entities to access an app that has its permission type set to named_entities ) + g.command 'add' do |c| + 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.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_apps_permissions_add(options)) + end + end + + g.desc 'Returns the permission type of an app and if applicable, includes the entities that have been granted access' + g.long_desc %( Returns the permission type of an app and if applicable, includes the entities that have been granted access ) + g.command 'list' do |c| + c.flag 'app_id', desc: 'Encoded ID of the app.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_apps_permissions_list(options)) + end + end + + g.desc "Revoke an entity's access to an app that has its permission type set to named_entities" + g.long_desc %( Revoke an entity's access to an app that has its permission type set to named_entities ) + g.command 'remove' do |c| + 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.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_apps_permissions_remove(options)) + end + end + + g.desc 'Set the permission type for who can access an app' + g.long_desc %( Set the permission type for who can access an app ) + g.command 'set' do |c| + c.flag 'app_id', desc: 'Encoded ID of the 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.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_apps_permissions_set(options)) + end + end + end + end + end +end diff --git a/bin/commands/canvases.rb b/bin/commands/canvases.rb index 540d08c2..b863fc16 100644 --- a/bin/commands/canvases.rb +++ b/bin/commands/canvases.rb @@ -10,7 +10,7 @@ class App g.long_desc %( Create canvas for a user ) g.command 'create' do |c| c.flag 'title', desc: 'Title of the newly created canvas.' - c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.' + c.flag 'document_content', desc: 'Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters).' c.flag 'channel_id', desc: 'Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams.' c.action do |_global_options, options, _args| puts JSON.dump(@client.canvases_create(options)) @@ -30,7 +30,7 @@ class App g.long_desc %( Update an existing canvas ) g.command 'edit' do |c| c.flag 'canvas_id', desc: 'Encoded ID of the canvas.' - c.flag 'changes', desc: 'List of changes to apply on the specified canvas.' + c.flag 'changes', desc: 'List of changes to apply on the specified canvas. The markdown content of each change is limited to 1 MiB (1,048,576 characters).' c.action do |_global_options, options, _args| puts JSON.dump(@client.canvases_edit(options)) end diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index ebd9008f..7c2d4c91 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -82,6 +82,7 @@ class App c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.' c.flag 'link_names', desc: 'Find and link channel names and usernames.' c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.' + c.flag 'metadata', desc: 'JSON object with an entities array of work object entity metadata, presented as a URL-encoded string. Only entity metadata is supported: ephemeral messages are not persisted and never dispatch message_metadata_* events, so event_type/event_payload message metadata is ignored here. Each entity requires entity_type, entity_payload, external_ref, and url.' c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.' c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.' c.flag 'thread_ts', desc: "Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread." diff --git a/bin/commands/conversations_canvases.rb b/bin/commands/conversations_canvases.rb index 0deb32df..b3c4e6f2 100644 --- a/bin/commands/conversations_canvases.rb +++ b/bin/commands/conversations_canvases.rb @@ -10,7 +10,7 @@ class App g.long_desc %( Create a channel canvas for a channel ) g.command 'create' do |c| c.flag 'channel_id', desc: 'Channel ID of the channel the canvas will be tabbed in.' - c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.' + c.flag 'document_content', desc: 'Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters).' c.flag 'title', desc: 'Title of the newly created canvas.' c.action do |_global_options, options, _args| puts JSON.dump(@client.conversations_canvases_create(options)) diff --git a/bin/commands/entity.rb b/bin/commands/entity.rb index 057fa48f..12db731c 100644 --- a/bin/commands/entity.rb +++ b/bin/commands/entity.rb @@ -6,6 +6,33 @@ module Cli class App desc 'Entity methods.' command 'entity' do |g| + g.desc 'Acknowledge a comment mutation (edit, delete, or post) on a work object entity. Apps call this endpoint to confirm they have processed a comment action, and the backend emits a dedicated RTM event to the user.' + g.long_desc %( Acknowledge a comment mutation (edit, delete, or post) on a work object entity. Apps call this endpoint to confirm they have processed a comment action, and the backend emits a dedicated RTM event to the user. ) + g.command 'acknowledgeCommentAction' do |c| + c.flag 'trigger_id', desc: 'A reference to the original user action that initiated the comment mutation.' + c.flag 'comment', desc: 'The full comment data. Required for edit and post actions. See the comment schema for the full list of properties.' + c.flag 'error', desc: 'Error message if the action failed in the app. When present, signals that the mutation could not be completed.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.entity_acknowledgeCommentAction(options)) + end + end + + g.desc 'Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client.' + g.long_desc %( Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client. ) + g.command 'presentComments' do |c| + c.flag 'comments', desc: 'Array of comments to present to the user. See the comment schema for the full list of properties.' + c.flag 'cursor', desc: 'App supplied cursor used for pagination, will be sent in the next request for comments.' + c.flag 'can_post_comment', desc: 'Indicates whether the user has permissions to post comments.' + c.flag 'trigger_id', desc: 'A reference to the original user action that initiated the request.' + c.flag 'delete_action_id', desc: 'The block action id that will be sent when a delete request is initiated for a comment.' + c.flag 'user_auth_required', desc: 'Set to true (or 1) to indicate that the user must authenticate to see the comments data.' + c.flag 'user_auth_url', desc: 'A custom URL to which users are directed for authentication if required.' + c.flag 'error', desc: '' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.entity_presentComments(options)) + end + end + g.desc 'Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client.' g.long_desc %( Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client. ) g.command 'presentDetails' do |c| diff --git a/bin/commands/files.rb b/bin/commands/files.rb index 15d99716..2c53f83c 100644 --- a/bin/commands/files.rb +++ b/bin/commands/files.rb @@ -15,6 +15,9 @@ class App c.flag 'channels', desc: 'Comma-separated string of channel IDs or user IDs where the file will be shared.' c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.' c.flag 'blocks', desc: 'A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the initial_comment field is provided, the blocks field is ignored.' + c.flag 'username', desc: "Set your bot's user name for the file share message. Requires the chat:write.customize scope." + c.flag 'icon_url', desc: 'URL to an image to use as the icon for the file share message. Requires the chat:write.customize scope.' + c.flag 'icon_emoji', desc: 'Emoji to use as the icon for the file share message. Overrides icon_url. Requires the chat:write.customize scope.' c.action do |_global_options, options, _args| puts JSON.dump(@client.files_completeUploadExternal(options)) end diff --git a/bin/commands/slackLists_download.rb b/bin/commands/slackLists_download.rb index 97c9d84c..fbc01d96 100644 --- a/bin/commands/slackLists_download.rb +++ b/bin/commands/slackLists_download.rb @@ -11,6 +11,9 @@ class App g.command 'get' do |c| c.flag 'list_id', desc: 'ID of the List to export.' c.flag 'job_id', desc: 'The ID of the recently started job to export the List.' + c.flag 'format', desc: 'Format the export was started with. Must match the format passed to slackLists.download.start. Defaults to csv.' + c.flag 'include_threads', desc: 'Must match the include_threads passed to slackLists.download.start. The returned download_url carries this through so the served export matches what was generated. Only applies when format is json.' + c.flag 'include_attachments', desc: 'Must match the include_attachments passed to slackLists.download.start. The returned download_url carries this through so the served export matches what was generated. Only applies when format is json.' c.action do |_global_options, options, _args| puts JSON.dump(@client.slackLists_download_get(options)) end @@ -21,6 +24,9 @@ class App g.command 'start' do |c| c.flag 'list_id', desc: 'ID of the List to export.' c.flag 'include_archived', desc: '' + c.flag 'format', desc: 'Format of the export. Defaults to csv for backward compatibility. Use json for a complete, hierarchical export.' + c.flag 'include_threads', desc: "Include each item's conversation thread in the export. Only applies when format is json." + c.flag 'include_attachments', desc: 'Include file attachment metadata and access paths in the export. Only applies when format is json.' c.action do |_global_options, options, _args| puts JSON.dump(@client.slackLists_download_start(options)) end diff --git a/bin/commands/users.rb b/bin/commands/users.rb index d6623b64..d0bfa3a9 100644 --- a/bin/commands/users.rb +++ b/bin/commands/users.rb @@ -11,6 +11,7 @@ class App g.command 'conversations' 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: 'Set to true to exclude archived channels from the list.' + c.flag 'exclude_muted', desc: 'Set to true to exclude muted channels from the list.' 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 with a max value of 999." c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.' 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.' diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index 01420745..02e3430b 100644 --- a/lib/slack/web/api/endpoints.rb +++ b/lib/slack/web/api/endpoints.rb @@ -7,6 +7,9 @@ require_relative 'endpoints/admin_apps_activities' require_relative 'endpoints/admin_apps_approved' require_relative 'endpoints/admin_apps_config' +require_relative 'endpoints/admin_apps_mcp_servers' +require_relative 'endpoints/admin_apps_mcp_servers_permissions' +require_relative 'endpoints/admin_apps_permissions' require_relative 'endpoints/admin_apps_requests' require_relative 'endpoints/admin_apps_restricted' require_relative 'endpoints/admin_audit_anomaly_allow' @@ -118,6 +121,9 @@ module Endpoints include AdminAppsActivities include AdminAppsApproved include AdminAppsConfig + include AdminAppsMcpServers + include AdminAppsMcpServersPermissions + include AdminAppsPermissions include AdminAppsRequests include AdminAppsRestricted include AdminAuditAnomalyAllow diff --git a/lib/slack/web/api/endpoints/admin_apps_mcp_servers.rb b/lib/slack/web/api/endpoints/admin_apps_mcp_servers.rb new file mode 100644 index 00000000..12d03eeb --- /dev/null +++ b/lib/slack/web/api/endpoints/admin_apps_mcp_servers.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AdminAppsMcpServers + # + # List third-party app MCP servers approved for an organization, derived from the org's MCP server allowlist. Entries reflect allowlist state, not install/scope liveness: servers of apps that are uninstalled (but not deleted) are still listed. + # + # @option options [integer] :limit + # The maximum number of items to return. Must be between 1 - 1000 both inclusive. + # @option options [string] :cursor + # Set cursor to next_cursor returned by the previous call to list items in the next page. + # @see https://api.slack.com/methods/admin.apps.mcp.servers.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.mcp.servers/admin.apps.mcp.servers.list.json + def admin_apps_mcp_servers_list(options = {}) + if block_given? + Pagination::Cursor.new(self, :admin_apps_mcp_servers_list, options).each do |page| + yield page + end + else + post('admin.apps.mcp.servers.list', options) + end + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/admin_apps_mcp_servers_permissions.rb b/lib/slack/web/api/endpoints/admin_apps_mcp_servers_permissions.rb new file mode 100644 index 00000000..4df9237b --- /dev/null +++ b/lib/slack/web/api/endpoints/admin_apps_mcp_servers_permissions.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AdminAppsMcpServersPermissions + # + # List MCP servers for an app with their access control permissions + # + # @option options [string] :app_id + # Encoded ID of the app. + # @see https://api.slack.com/methods/admin.apps.mcp.servers.permissions.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.mcp.servers.permissions/admin.apps.mcp.servers.permissions.list.json + def admin_apps_mcp_servers_permissions_list(options = {}) + raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil? + post('admin.apps.mcp.servers.permissions.list', options) + end + + # + # Set the access control permission for who can use an MCP server + # + # @option options [string] :app_id + # Encoded ID of the app. + # @option options [string] :server_id + # Encoded ID of the MCP server. + # @option options [enum] :permission_type + # The type of permission that defines who can use this MCP server. + # @option options [array] :user_ids + # List of user IDs to set for named_entities or named_entities_exclude. + # @option options [array] :usergroup_ids + # List of encoded usergroup IDs. + # @see https://api.slack.com/methods/admin.apps.mcp.servers.permissions.set + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.mcp.servers.permissions/admin.apps.mcp.servers.permissions.set.json + def admin_apps_mcp_servers_permissions_set(options = {}) + raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil? + raise ArgumentError, 'Required arguments :server_id missing' if options[:server_id].nil? + raise ArgumentError, 'Required arguments :permission_type missing' if options[:permission_type].nil? + post('admin.apps.mcp.servers.permissions.set', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/admin_apps_permissions.rb b/lib/slack/web/api/endpoints/admin_apps_permissions.rb new file mode 100644 index 00000000..e048a381 --- /dev/null +++ b/lib/slack/web/api/endpoints/admin_apps_permissions.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AdminAppsPermissions + # + # Grant permission for entities to access an app that has its permission type set to named_entities + # + # @option options [string] :app_id + # Encoded ID of the app. + # @option options [array] :user_ids + # List of user IDs to allow for named_entities visibility. + # @option options [array] :usergroup_ids + # List of encoded usergroup IDs. + # @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 = {}) + raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil? + post('admin.apps.permissions.add', options) + end + + # + # Returns the permission type of an app and if applicable, includes the entities that have been granted access + # + # @option options [string] :app_id + # Encoded ID of the app. + # @see https://api.slack.com/methods/admin.apps.permissions.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.permissions/admin.apps.permissions.list.json + def admin_apps_permissions_list(options = {}) + raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil? + post('admin.apps.permissions.list', options) + end + + # + # Revoke an entity's access to an app that has its permission type set to named_entities + # + # @option options [string] :app_id + # Encoded ID of the app. + # @option options [array] :user_ids + # List of user IDs whose named_entities access will be revoked. + # @option options [array] :usergroup_ids + # List of encoded usergroup IDs. + # @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 = {}) + raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil? + post('admin.apps.permissions.remove', options) + end + + # + # Set the permission type for who can access an app + # + # @option options [string] :app_id + # Encoded ID of the app. + # @option options [enum] :permission_type + # The type of permission that defines who can access the app. + # @option options [array] :user_ids + # List of user IDs to allow for named_entities visibility. + # @option options [array] :usergroup_ids + # List of encoded usergroup IDs. + # @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 = {}) + raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil? + raise ArgumentError, 'Required arguments :permission_type missing' if options[:permission_type].nil? + post('admin.apps.permissions.set', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/admin_emoji.rb b/lib/slack/web/api/endpoints/admin_emoji.rb index 98e2676c..028d7479 100644 --- a/lib/slack/web/api/endpoints/admin_emoji.rb +++ b/lib/slack/web/api/endpoints/admin_emoji.rb @@ -17,7 +17,6 @@ module AdminEmoji # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.add.json def admin_emoji_add(options = {}) raise ArgumentError, 'Required arguments :name missing' if options[:name].nil? - raise ArgumentError, 'Required arguments :url missing' if options[:url].nil? post('admin.emoji.add', options) end diff --git a/lib/slack/web/api/endpoints/canvases.rb b/lib/slack/web/api/endpoints/canvases.rb index 739eb69c..cdbb65e2 100644 --- a/lib/slack/web/api/endpoints/canvases.rb +++ b/lib/slack/web/api/endpoints/canvases.rb @@ -12,7 +12,7 @@ module Canvases # @option options [string] :title # Title of the newly created canvas. # @option options [Object] :document_content - # Structure describing the type and value of the content to create. + # Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters). # @option options [string] :channel_id # Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams. # @see https://api.slack.com/methods/canvases.create @@ -39,7 +39,7 @@ def canvases_delete(options = {}) # @option options [Object] :canvas_id # Encoded ID of the canvas. # @option options [array] :changes - # List of changes to apply on the specified canvas. + # List of changes to apply on the specified canvas. The markdown content of each change is limited to 1 MiB (1,048,576 characters). # @see https://api.slack.com/methods/canvases.edit # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.edit.json def canvases_edit(options = {}) diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 01149859..20831c5e 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -131,6 +131,8 @@ def chat_meMessage(options = {}) # Find and link channel names and usernames. # @option options [string] :markdown_text # Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters. + # @option options [string] :metadata + # JSON object with an entities array of work object entity metadata, presented as a URL-encoded string. Only entity metadata is supported: ephemeral messages are not persisted and never dispatch message_metadata_* events, so event_type/event_payload message metadata is ignored here. Each entity requires entity_type, entity_payload, external_ref, and url. # @option options [string] :parse # Change how messages are treated. Defaults to none. See below. # @option options [string] :text @@ -149,7 +151,7 @@ def chat_postEphemeral(options = {}) raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil? raise ArgumentError, ':text, :markdown_text are mutually exclusive' if !options[:text].nil? && !options[:markdown_text].nil? options = options.merge(user: users_id(options)['user']['id']) if options[:user] - options = encode_options_as_json(options, %i[attachments blocks]) + options = encode_options_as_json(options, %i[attachments blocks metadata]) post('chat.postEphemeral', options) end diff --git a/lib/slack/web/api/endpoints/conversations_canvases.rb b/lib/slack/web/api/endpoints/conversations_canvases.rb index e9601a23..7e4c9199 100644 --- a/lib/slack/web/api/endpoints/conversations_canvases.rb +++ b/lib/slack/web/api/endpoints/conversations_canvases.rb @@ -12,7 +12,7 @@ module ConversationsCanvases # @option options [string] :channel_id # Channel ID of the channel the canvas will be tabbed in. # @option options [Object] :document_content - # Structure describing the type and value of the content to create. + # Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters). # @option options [string] :title # Title of the newly created canvas. # @see https://api.slack.com/methods/conversations.canvases.create diff --git a/lib/slack/web/api/endpoints/entity.rb b/lib/slack/web/api/endpoints/entity.rb index 91dcc29e..7e48984a 100644 --- a/lib/slack/web/api/endpoints/entity.rb +++ b/lib/slack/web/api/endpoints/entity.rb @@ -6,6 +6,54 @@ module Web module Api module Endpoints module Entity + # + # Acknowledge a comment mutation (edit, delete, or post) on a work object entity. Apps call this endpoint to confirm they have processed a comment action, and the backend emits a dedicated RTM event to the user. + # + # @option options [string] :trigger_id + # A reference to the original user action that initiated the comment mutation. + # @option options [object] :comment + # The full comment data. Required for edit and post actions. See the comment schema for the full list of properties. + # @option options [string] :error + # Error message if the action failed in the app. When present, signals that the mutation could not be completed. + # @see https://api.slack.com/methods/entity.acknowledgeCommentAction + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/entity/entity.acknowledgeCommentAction.json + def entity_acknowledgeCommentAction(options = {}) + raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil? + post('entity.acknowledgeCommentAction', options) + end + + # + # Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client. + # + # @option options [array] :comments + # Array of comments to present to the user. See the comment schema for the full list of properties. + # @option options [string] :cursor + # App supplied cursor used for pagination, will be sent in the next request for comments. + # @option options [boolean] :can_post_comment + # Indicates whether the user has permissions to post comments. + # @option options [string] :trigger_id + # A reference to the original user action that initiated the request. + # @option options [string] :delete_action_id + # The block action id that will be sent when a delete request is initiated for a comment. + # @option options [boolean] :user_auth_required + # Set to true (or 1) to indicate that the user must authenticate to see the comments data. + # @option options [string] :user_auth_url + # A custom URL to which users are directed for authentication if required. + # @option options [Object] :error + # @see https://api.slack.com/methods/entity.presentComments + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/entity/entity.presentComments.json + def entity_presentComments(options = {}) + raise ArgumentError, 'Required arguments :comments missing' if options[:comments].nil? + raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil? + if block_given? + Pagination::Cursor.new(self, :entity_presentComments, options).each do |page| + yield page + end + else + post('entity.presentComments', options) + end + end + # # Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client. # diff --git a/lib/slack/web/api/endpoints/files.rb b/lib/slack/web/api/endpoints/files.rb index 86e7c1b1..13a18895 100644 --- a/lib/slack/web/api/endpoints/files.rb +++ b/lib/slack/web/api/endpoints/files.rb @@ -21,6 +21,12 @@ module Files # The message text introducing the file in specified channels. # @option options [string] :blocks # A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the initial_comment field is provided, the blocks field is ignored. + # @option options [string] :username + # Set your bot's user name for the file share message. Requires the chat:write.customize scope. + # @option options [string] :icon_url + # URL to an image to use as the icon for the file share message. Requires the chat:write.customize scope. + # @option options [string] :icon_emoji + # Emoji to use as the icon for the file share message. Overrides icon_url. Requires the chat:write.customize scope. # @see https://api.slack.com/methods/files.completeUploadExternal # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.completeUploadExternal.json def files_completeUploadExternal(options = {}) diff --git a/lib/slack/web/api/endpoints/slackLists_download.rb b/lib/slack/web/api/endpoints/slackLists_download.rb index f3b4c87d..d9b67c5c 100644 --- a/lib/slack/web/api/endpoints/slackLists_download.rb +++ b/lib/slack/web/api/endpoints/slackLists_download.rb @@ -13,6 +13,12 @@ module SlackListsDownload # ID of the List to export. # @option options [string] :job_id # The ID of the recently started job to export the List. + # @option options [Object] :format + # Format the export was started with. Must match the format passed to slackLists.download.start. Defaults to csv. + # @option options [boolean] :include_threads + # Must match the include_threads passed to slackLists.download.start. The returned download_url carries this through so the served export matches what was generated. Only applies when format is json. + # @option options [boolean] :include_attachments + # Must match the include_attachments passed to slackLists.download.start. The returned download_url carries this through so the served export matches what was generated. Only applies when format is json. # @see https://api.slack.com/methods/slackLists.download.get # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/slackLists.download/slackLists.download.get.json def slackLists_download_get(options = {}) @@ -27,6 +33,12 @@ def slackLists_download_get(options = {}) # @option options [string] :list_id # ID of the List to export. # @option options [boolean] :include_archived + # @option options [Object] :format + # Format of the export. Defaults to csv for backward compatibility. Use json for a complete, hierarchical export. + # @option options [boolean] :include_threads + # Include each item's conversation thread in the export. Only applies when format is json. + # @option options [boolean] :include_attachments + # Include file attachment metadata and access paths in the export. Only applies when format is json. # @see https://api.slack.com/methods/slackLists.download.start # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/slackLists.download/slackLists.download.start.json def slackLists_download_start(options = {}) diff --git a/lib/slack/web/api/endpoints/users.rb b/lib/slack/web/api/endpoints/users.rb index 58e79f7f..534590ee 100644 --- a/lib/slack/web/api/endpoints/users.rb +++ b/lib/slack/web/api/endpoints/users.rb @@ -13,6 +13,8 @@ module Users # 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. # @option options [boolean] :exclude_archived # Set to true to exclude archived channels from the list. + # @option options [boolean] :exclude_muted + # Set to true to exclude muted channels from the list. # @option options [number] :limit # 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 with a max value of 999. # @option options [string] :team_id diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index dec42f5c..e3298816 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -25,6 +25,8 @@ class AlreadyStarred < SlackError; end class AltTxtTooLarge < SlackError; end class AnalyticsUnavailable < SlackError; end class AppAccessRestricted < SlackError; end + class AppAclNotFound < SlackError; end + class AppCannotJoinChannel < SlackError; end class AppManagementAppNotInstalledOnOrg < SlackError; end class AppMissingActionUrl < SlackError; end class AppNotEligible < SlackError; end @@ -134,6 +136,7 @@ class ChannelCanvasAlreadyExists < SlackError; end class ChannelCanvasCreationFailed < SlackError; end class ChannelConversionInProgress < SlackError; end class ChannelConversionIncomplete < SlackError; end + class ChannelIdsRequired < SlackError; end class ChannelIsArchived < SlackError; end class ChannelIsLimitedAccess < SlackError; end class ChannelIsNotPrivate < SlackError; end @@ -269,6 +272,7 @@ class FailedToSetUserToRegular < SlackError; end class FailedToStartTrial < SlackError; end class FailedToUnlinkChannel < SlackError; end class FailedToUnshare < SlackError; end + class FailedToUpdateChannels < SlackError; end class FailedToUpdateUserIds < SlackError; end class FailedToValidateCaller < SlackError; end class FailedToValidateChannels < SlackError; end @@ -301,6 +305,7 @@ class ForbiddenTeam < SlackError; end class FreeTeamCanvasTabAlreadyExists < SlackError; end class FreeTeamNotAllowed < SlackError; end class FreeTeamsCannotCreateNonTabbedCanvases < SlackError; end + class FreeTeamsCannotCreateStandaloneCanvases < SlackError; end class FreeTeamsCannotEditStandaloneCanvases < SlackError; end class FunctionExecutionNotFound < SlackError; end class FunctionNotFound < SlackError; end @@ -336,6 +341,7 @@ class InvalidCallId < SlackError; end class InvalidChannel < SlackError; end class InvalidChannelId < SlackError; end class InvalidChannelProvided < SlackError; end + class InvalidChannelRestrictionMode < SlackError; end class InvalidChannelType < SlackError; end class InvalidChannelsLimit < SlackError; end class InvalidCharset < SlackError; end @@ -358,6 +364,7 @@ class InvalidEmail < SlackError; end class InvalidEmoji < SlackError; end class InvalidEmojiNotAllowed < SlackError; end class InvalidEnterprise < SlackError; end + class InvalidEntities < SlackError; end class InvalidEntityId < SlackError; end class InvalidEventContext < SlackError; end class InvalidExternalId < SlackError; end @@ -411,6 +418,7 @@ class InvalidScheduledMessageId < SlackError; end class InvalidSchema < SlackError; end class InvalidScopes < SlackError; end class InvalidSearchChannelType < SlackError; end + class InvalidSenderSchema < SlackError; end class InvalidSetting < SlackError; end class InvalidShortcutType < SlackError; end class InvalidSort < SlackError; end @@ -495,6 +503,7 @@ class MetadataNotAvailable < SlackError; end class MetadataOnlyDoesNotSupportDate < SlackError; end class MetadataTooLarge < SlackError; end class MethodDeprecated < SlackError; end + class MethodNotFound < SlackError; end class MethodNotSupported < SlackError; end class MethodNotSupportedForChannelType < SlackError; end class MigrationInProgress < SlackError; end @@ -503,6 +512,8 @@ class MissingArgs < SlackError; end class MissingArgument < SlackError; end class MissingArguments < SlackError; end class MissingChannel < SlackError; end + class MissingCommentData < SlackError; end + class MissingDeleteActionId < SlackError; end class MissingDialog < SlackError; end class MissingDuration < SlackError; end class MissingFileData < SlackError; end @@ -529,6 +540,7 @@ class MissingUser < SlackError; end class MsgBlocksTooLong < SlackError; end class MsgBlocksTooMany < SlackError; end class MsgTooLong < SlackError; end + class MultiWorkspaceRestriction < SlackError; end class MustClearBothStatusTextAndStatusEmoji < SlackError; end class MustProvideTeamDomain < SlackError; end class MustProvideTeamName < SlackError; end @@ -574,6 +586,7 @@ class NoValidNamedEntities < SlackError; end class NoValidTeams < SlackError; end class NoValidUsers < SlackError; end class NotAdmin < SlackError; end + class NotAgentApp < SlackError; end class NotAllowed < SlackError; end class NotAllowedForGridWorkspace < SlackError; end class NotAllowedToCreateAutomationRule < SlackError; end @@ -671,7 +684,11 @@ class RetentionOverrideNotAllowed < SlackError; end class RowIdNotProvided < SlackError; end class RowNotFound < SlackError; end class RtmConnectRequired < SlackError; end + class SendOnBehalfNotAllowed < SlackError; end class SentRecently < SlackError; end + class ServerAclEntitiesNotInScope < SlackError; end + class ServerAclTypeBroaderThanApp < SlackError; end + class ServerNotFound < SlackError; end class ServiceUnavailable < SlackError; end class SessionInvalidationFailed < SlackError; end class SessionNotFound < SlackError; end @@ -778,6 +795,7 @@ class UserAuthUrlMissing < SlackError; end class UserCannotCreateChannel < SlackError; end class UserCannotManagePublicChannels < SlackError; end class UserCannotManageWorkspace < SlackError; end + class UserChannelLimitExceeded < SlackError; end class UserDisabled < SlackError; end class UserDoesNotOwnChannel < SlackError; end class UserEmailUnverified < SlackError; end @@ -826,6 +844,8 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'alt_txt_too_large' => AltTxtTooLarge, 'analytics_unavailable' => AnalyticsUnavailable, 'app_access_restricted' => AppAccessRestricted, + 'app_acl_not_found' => AppAclNotFound, + 'app_cannot_join_channel' => AppCannotJoinChannel, 'app_management_app_not_installed_on_org' => AppManagementAppNotInstalledOnOrg, 'app_missing_action_url' => AppMissingActionUrl, 'app_not_eligible' => AppNotEligible, @@ -935,6 +955,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'channel_canvas_creation_failed' => ChannelCanvasCreationFailed, 'channel_conversion_in_progress' => ChannelConversionInProgress, 'channel_conversion_incomplete' => ChannelConversionIncomplete, + 'channel_ids_required' => ChannelIdsRequired, 'channel_is_archived' => ChannelIsArchived, 'channel_is_limited_access' => ChannelIsLimitedAccess, 'channel_is_not_private' => ChannelIsNotPrivate, @@ -1070,6 +1091,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'failed_to_start_trial' => FailedToStartTrial, 'failed_to_unlink_channel' => FailedToUnlinkChannel, 'failed_to_unshare' => FailedToUnshare, + 'failed_to_update_channels' => FailedToUpdateChannels, 'failed_to_update_user_ids' => FailedToUpdateUserIds, 'failed_to_validate_caller' => FailedToValidateCaller, 'failed_to_validate_channels' => FailedToValidateChannels, @@ -1102,6 +1124,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'free_team_canvas_tab_already_exists' => FreeTeamCanvasTabAlreadyExists, 'free_team_not_allowed' => FreeTeamNotAllowed, 'free_teams_cannot_create_non_tabbed_canvases' => FreeTeamsCannotCreateNonTabbedCanvases, + 'free_teams_cannot_create_standalone_canvases' => FreeTeamsCannotCreateStandaloneCanvases, 'free_teams_cannot_edit_standalone_canvases' => FreeTeamsCannotEditStandaloneCanvases, 'function_execution_not_found' => FunctionExecutionNotFound, 'function_not_found' => FunctionNotFound, @@ -1137,6 +1160,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'invalid_channel' => InvalidChannel, 'invalid_channel_id' => InvalidChannelId, 'invalid_channel_provided' => InvalidChannelProvided, + 'invalid_channel_restriction_mode' => InvalidChannelRestrictionMode, 'invalid_channel_type' => InvalidChannelType, 'invalid_channels_limit' => InvalidChannelsLimit, 'invalid_charset' => InvalidCharset, @@ -1159,6 +1183,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'invalid_emoji' => InvalidEmoji, 'invalid_emoji_not_allowed' => InvalidEmojiNotAllowed, 'invalid_enterprise' => InvalidEnterprise, + 'invalid_entities' => InvalidEntities, 'invalid_entity_id' => InvalidEntityId, 'invalid_event_context' => InvalidEventContext, 'invalid_external_id' => InvalidExternalId, @@ -1212,6 +1237,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'invalid_schema' => InvalidSchema, 'invalid_scopes' => InvalidScopes, 'invalid_search_channel_type' => InvalidSearchChannelType, + 'invalid_sender_schema' => InvalidSenderSchema, 'invalid_setting' => InvalidSetting, 'invalid_shortcut_type' => InvalidShortcutType, 'invalid_sort' => InvalidSort, @@ -1296,6 +1322,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'metadata_only_does_not_support_date' => MetadataOnlyDoesNotSupportDate, 'metadata_too_large' => MetadataTooLarge, 'method_deprecated' => MethodDeprecated, + 'method_not_found' => MethodNotFound, 'method_not_supported' => MethodNotSupported, 'method_not_supported_for_channel_type' => MethodNotSupportedForChannelType, 'migration_in_progress' => MigrationInProgress, @@ -1304,6 +1331,8 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'missing_argument' => MissingArgument, 'missing_arguments' => MissingArguments, 'missing_channel' => MissingChannel, + 'missing_comment_data' => MissingCommentData, + 'missing_delete_action_id' => MissingDeleteActionId, 'missing_dialog' => MissingDialog, 'missing_duration' => MissingDuration, 'missing_file_data' => MissingFileData, @@ -1330,6 +1359,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'msg_blocks_too_long' => MsgBlocksTooLong, 'msg_blocks_too_many' => MsgBlocksTooMany, 'msg_too_long' => MsgTooLong, + 'multi_workspace_restriction' => MultiWorkspaceRestriction, 'must_clear_both_status_text_and_status_emoji' => MustClearBothStatusTextAndStatusEmoji, 'must_provide_team_domain' => MustProvideTeamDomain, 'must_provide_team_name' => MustProvideTeamName, @@ -1375,6 +1405,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'no_valid_teams' => NoValidTeams, 'no_valid_users' => NoValidUsers, 'not_admin' => NotAdmin, + 'not_agent_app' => NotAgentApp, 'not_allowed' => NotAllowed, 'not_allowed_for_grid_workspace' => NotAllowedForGridWorkspace, 'not_allowed_to_create_automation_rule' => NotAllowedToCreateAutomationRule, @@ -1472,7 +1503,11 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'row_id_not_provided' => RowIdNotProvided, 'row_not_found' => RowNotFound, 'rtm_connect_required' => RtmConnectRequired, + 'send_on_behalf_not_allowed' => SendOnBehalfNotAllowed, 'sent_recently' => SentRecently, + 'server_acl_entities_not_in_scope' => ServerAclEntitiesNotInScope, + 'server_acl_type_broader_than_app' => ServerAclTypeBroaderThanApp, + 'server_not_found' => ServerNotFound, 'service_unavailable' => ServiceUnavailable, 'session_invalidation_failed' => SessionInvalidationFailed, 'session_not_found' => SessionNotFound, @@ -1579,6 +1614,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'user_cannot_create_channel' => UserCannotCreateChannel, 'user_cannot_manage_public_channels' => UserCannotManagePublicChannels, 'user_cannot_manage_workspace' => UserCannotManageWorkspace, + 'user_channel_limit_exceeded' => UserChannelLimitExceeded, 'user_disabled' => UserDisabled, 'user_does_not_own_channel' => UserDoesNotOwnChannel, 'user_email_unverified' => UserEmailUnverified, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 784d1d42..2895c4d2 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 784d1d4212a1ab31b1f7aaf575cb585fa429577a +Subproject commit 2895c4d2a06e45d67a3a27c3005a33f9d95d9168 diff --git a/spec/slack/web/api/endpoints/admin_apps_mcp_servers_permissions_spec.rb b/spec/slack/web/api/endpoints/admin_apps_mcp_servers_permissions_spec.rb new file mode 100644 index 00000000..042df222 --- /dev/null +++ b/spec/slack/web/api/endpoints/admin_apps_mcp_servers_permissions_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AdminAppsMcpServersPermissions do + let(:client) { Slack::Web::Client.new } + context 'admin.apps.mcp.servers.permissions_list' do + it 'requires app_id' do + expect { client.admin_apps_mcp_servers_permissions_list }.to raise_error ArgumentError, /Required arguments :app_id missing/ + end + end + context 'admin.apps.mcp.servers.permissions_set' do + it 'requires app_id' do + expect { client.admin_apps_mcp_servers_permissions_set(server_id: %q[Amcp0000000001], permission_type: %q[]) }.to raise_error ArgumentError, /Required arguments :app_id missing/ + end + it 'requires server_id' do + expect { client.admin_apps_mcp_servers_permissions_set(app_id: %q[A0000000001], permission_type: %q[]) }.to raise_error ArgumentError, /Required arguments :server_id missing/ + end + it 'requires permission_type' do + expect { client.admin_apps_mcp_servers_permissions_set(app_id: %q[A0000000001], server_id: %q[Amcp0000000001]) }.to raise_error ArgumentError, /Required arguments :permission_type missing/ + end + end +end diff --git a/spec/slack/web/api/endpoints/admin_apps_mcp_servers_spec.rb b/spec/slack/web/api/endpoints/admin_apps_mcp_servers_spec.rb new file mode 100644 index 00000000..c90b884f --- /dev/null +++ b/spec/slack/web/api/endpoints/admin_apps_mcp_servers_spec.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AdminAppsMcpServers do + let(:client) { Slack::Web::Client.new } +end diff --git a/spec/slack/web/api/endpoints/admin_apps_permissions_spec.rb b/spec/slack/web/api/endpoints/admin_apps_permissions_spec.rb new file mode 100644 index 00000000..b0406c4f --- /dev/null +++ b/spec/slack/web/api/endpoints/admin_apps_permissions_spec.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AdminAppsPermissions do + let(:client) { Slack::Web::Client.new } + context 'admin.apps.permissions_add' do + it 'requires app_id' do + expect { client.admin_apps_permissions_add }.to raise_error ArgumentError, /Required arguments :app_id missing/ + end + end + context 'admin.apps.permissions_list' do + it 'requires app_id' do + expect { client.admin_apps_permissions_list }.to raise_error ArgumentError, /Required arguments :app_id missing/ + end + end + context 'admin.apps.permissions_remove' do + it 'requires app_id' do + expect { client.admin_apps_permissions_remove }.to raise_error ArgumentError, /Required arguments :app_id missing/ + end + end + context 'admin.apps.permissions_set' do + it 'requires app_id' do + expect { client.admin_apps_permissions_set(permission_type: %q[]) }.to raise_error ArgumentError, /Required arguments :app_id missing/ + end + it 'requires permission_type' do + expect { client.admin_apps_permissions_set(app_id: %q[A0000000001]) }.to raise_error ArgumentError, /Required arguments :permission_type missing/ + end + end +end diff --git a/spec/slack/web/api/endpoints/admin_emoji_spec.rb b/spec/slack/web/api/endpoints/admin_emoji_spec.rb index 91d84dac..a313a0f5 100644 --- a/spec/slack/web/api/endpoints/admin_emoji_spec.rb +++ b/spec/slack/web/api/endpoints/admin_emoji_spec.rb @@ -7,10 +7,7 @@ let(:client) { Slack::Web::Client.new } context 'admin.emoji_add' do it 'requires name' do - expect { client.admin_emoji_add(url: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/ - end - it 'requires url' do - expect { client.admin_emoji_add(name: %q[]) }.to raise_error ArgumentError, /Required arguments :url missing/ + expect { client.admin_emoji_add }.to raise_error ArgumentError, /Required arguments :name missing/ end end context 'admin.emoji_addAlias' do diff --git a/spec/slack/web/api/endpoints/chat_spec.rb b/spec/slack/web/api/endpoints/chat_spec.rb index 2184c5e6..acafaac1 100644 --- a/spec/slack/web/api/endpoints/chat_spec.rb +++ b/spec/slack/web/api/endpoints/chat_spec.rb @@ -117,9 +117,9 @@ expect { client.chat_postEphemeral(text: %q[Hello world], markdown_text: %q[**This is bold text**], attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[], user: %q[U0BPQUNTA]) }.to raise_error ArgumentError, /mutually exclusive/ end - it 'encodes attachments, blocks as json' do - expect(client).to receive(:post).with('chat.postEphemeral', {attachments: %q[{"data":["data"]}], channel: %q[], text: %q[Hello world], user: %q[U0BPQUNTA], blocks: %q[{"data":["data"]}]}) - client.chat_postEphemeral(attachments: {data: ["data"]}, channel: %q[], text: %q[Hello world], user: %q[U0BPQUNTA], blocks: {data: ["data"]}) + it 'encodes attachments, blocks, metadata as json' do + expect(client).to receive(:post).with('chat.postEphemeral', {attachments: %q[{"data":["data"]}], channel: %q[], text: %q[Hello world], user: %q[U0BPQUNTA], blocks: %q[{"data":["data"]}], metadata: %q[{"data":["data"]}]}) + client.chat_postEphemeral(attachments: {data: ["data"]}, channel: %q[], text: %q[Hello world], user: %q[U0BPQUNTA], blocks: {data: ["data"]}, metadata: {data: ["data"]}) end end context 'chat_postMessage' do diff --git a/spec/slack/web/api/endpoints/entity_spec.rb b/spec/slack/web/api/endpoints/entity_spec.rb index ad7dd194..8e74e3cb 100644 --- a/spec/slack/web/api/endpoints/entity_spec.rb +++ b/spec/slack/web/api/endpoints/entity_spec.rb @@ -5,6 +5,19 @@ RSpec.describe Slack::Web::Api::Endpoints::Entity do let(:client) { Slack::Web::Client.new } + context 'entity_acknowledgeCommentAction' do + it 'requires trigger_id' do + expect { client.entity_acknowledgeCommentAction }.to raise_error ArgumentError, /Required arguments :trigger_id missing/ + end + end + context 'entity_presentComments' do + it 'requires comments' do + expect { client.entity_presentComments(trigger_id: %q[]) }.to raise_error ArgumentError, /Required arguments :comments missing/ + end + it 'requires trigger_id' do + expect { client.entity_presentComments(comments: %q[]) }.to raise_error ArgumentError, /Required arguments :trigger_id missing/ + end + end context 'entity_presentDetails' do it 'requires trigger_id' do expect { client.entity_presentDetails }.to raise_error ArgumentError, /Required arguments :trigger_id missing/