diff --git a/bin/commands/admin_apps_activities.rb b/bin/commands/admin_apps_activities.rb index 4a4da63a..b52d513d 100644 --- a/bin/commands/admin_apps_activities.rb +++ b/bin/commands/admin_apps_activities.rb @@ -10,16 +10,16 @@ class App g.long_desc %( Get logs for a specified team/org ) g.command 'list' do |c| c.flag 'app_id', desc: 'The ID of the app to get activities from.' - c.flag 'component_id', desc: "The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows." - c.flag 'component_type', desc: "The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables')." + c.flag 'component_id', desc: 'The component ID of log events to be returned. Will be FnXXXXXX for functions, and WfXXXXXX for worflows.' + c.flag 'component_type', desc: 'The component type of log events to be returned. Acceptable values are events_api, workflows, functions and tables.' 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. See pagination for more detail." c.flag 'limit', desc: 'The maximum number of items to return.' c.flag 'log_event_type', desc: 'The event type of log events to be returned.' c.flag 'max_date_created', desc: 'The latest timestamp of the log to retrieve (epoch microseconds).' c.flag 'min_date_created', desc: 'The earliest timestamp of the log to retrieve (epoch microseconds).' - c.flag 'min_log_level', desc: "The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal')." + c.flag 'min_log_level', desc: 'The minimum log level of the log events to be returned. Defaults to info. Acceptable values (in order of relative importance from smallest to largest) are trace, debug, info, warn, error and fatal.' c.flag 'sort_direction', desc: 'The direction you want the data sorted by (always by timestamp).' - c.flag 'source', desc: "The source of log events to be returned. Acceptable values are ('slack', 'developer')." + c.flag 'source', desc: 'The source of log events to be returned. Acceptable values are slack and developer.' c.flag 'team_id', desc: 'The team who owns this log.' c.flag 'trace_id', desc: 'The trace ID of log events to be returned.' c.action do |_global_options, options, _args| diff --git a/bin/commands/admin_apps_config.rb b/bin/commands/admin_apps_config.rb index dd6b912f..8ac4cf8f 100644 --- a/bin/commands/admin_apps_config.rb +++ b/bin/commands/admin_apps_config.rb @@ -19,8 +19,8 @@ class App g.long_desc %( Set the app config for a connector ) g.command 'set' do |c| c.flag 'app_id', desc: 'The encoded app ID to set the app config for.' - c.flag 'domain_restrictions', desc: 'Domain restrictions for the app.' - c.flag 'workflow_auth_strategy', desc: 'The workflow auth permission.' + c.flag 'domain_restrictions', desc: 'Domain restrictions for the app. Should be an object with two properties: urls and emails. Each is an array of strings, and each sets the allowed URLs and emails for connector authorization, respectively.' + c.flag 'workflow_auth_strategy', desc: 'The workflow auth permission. Can be one of builder_choice or end_user_only.' c.action do |_global_options, options, _args| puts JSON.dump(@client.admin_apps_config_set(options)) end diff --git a/bin/commands/admin_conversations.rb b/bin/commands/admin_conversations.rb index 71ff12f6..a2a27ba0 100644 --- a/bin/commands/admin_conversations.rb +++ b/bin/commands/admin_conversations.rb @@ -176,6 +176,7 @@ class App c.flag 'sort', desc: 'Possible values are relevant (search ranking based on what we think is closest), name (alphabetical), member_count (number of users in the channel), and created (date channel was created). You can optionally pair this with the sort_dir arg to change how it is sorted.' c.flag 'sort_dir', desc: 'Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a).' c.flag 'team_ids', desc: 'Comma separated string of team IDs, signifying the internal workspaces to search through.' + c.flag 'total_count_only', desc: 'Only return the total_count of channels. Omits channel data and allows access for admins without channel manager permissions.' c.action do |_global_options, options, _args| puts JSON.dump(@client.admin_conversations_search(options)) end diff --git a/bin/commands/admin_users.rb b/bin/commands/admin_users.rb index a3a50ec1..fb6de45c 100644 --- a/bin/commands/admin_users.rb +++ b/bin/commands/admin_users.rb @@ -41,6 +41,8 @@ class App g.long_desc %( List users on a workspace ) g.command 'list' do |c| c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.' + c.flag 'include_deactivated_workspaces', desc: 'Only applies with org token and no team_id. If true, both active and deactivated workspaces are returned for a user in workspaces. If false, only active workspaces are returned for a user in workspaces. Default is false.' + c.flag 'is_active', desc: 'If true, only active users will be returned. If false, only deactivated users will be returned. Default is true.' c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.' c.flag 'team_id', desc: 'The ID (T1234) of the workspace. The team_id is required if you use an org-level token.' c.action do |_global_options, options, _args| diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index 33936f24..bec2e25e 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -94,6 +94,7 @@ class App c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.' c.flag 'parse', desc: 'Change how messages are treated. See below.' c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.' + c.flag 'service_team_id', desc: 'For a message posted in App Home, Team ID corresponding to the selected app installation.' c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead." c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.' c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.' @@ -148,13 +149,13 @@ class App c.flag 'ts', desc: 'Timestamp of the message to be updated.' c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.' c.flag 'attachments', desc: "A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field." - c.flag 'blocks', desc: "A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field." + c.flag 'blocks', desc: "A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will only be retained if the text argument is not provided. If the text argument is provided and blocks are not provided, the blocks will be unset. To remove previous blocks, include an empty array for this field." c.flag 'file_ids', desc: 'Array of new file ids that will be sent with this message.' c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.' c.flag 'metadata', desc: "JSON object with event_type and event_payload fields, presented as a URL-encoded string. If you don't include this field, the message's previous metadata will be retained. To remove previous metadata, include an empty object for this field. Metadata you post to Slack is accessible to any app or user who is a member of that workspace." c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.' c.flag 'reply_broadcast', desc: 'Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.' - c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments." + c.flag 'text', desc: 'New text for the message, using the default formatting rules. This text, combined with either blocks or attachments, is used as fallback text for notifications.' c.action do |_global_options, options, _args| puts JSON.dump(@client.chat_update(options)) end diff --git a/bin/commands/conversations.rb b/bin/commands/conversations.rb index 59ee34c0..e38a6e97 100644 --- a/bin/commands/conversations.rb +++ b/bin/commands/conversations.rb @@ -150,7 +150,7 @@ class App 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: 'Set to true to exclude archived 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 no larger than 1000." + 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 under 1000." c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.' 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.' c.action do |_global_options, options, _args| diff --git a/lib/slack/web/api/endpoints/admin_apps_activities.rb b/lib/slack/web/api/endpoints/admin_apps_activities.rb index 99f9870e..988c4745 100644 --- a/lib/slack/web/api/endpoints/admin_apps_activities.rb +++ b/lib/slack/web/api/endpoints/admin_apps_activities.rb @@ -12,9 +12,9 @@ module AdminAppsActivities # @option options [Object] :app_id # The ID of the app to get activities from. # @option options [string] :component_id - # The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows. + # The component ID of log events to be returned. Will be FnXXXXXX for functions, and WfXXXXXX for worflows. # @option options [string] :component_type - # The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables'). + # The component type of log events to be returned. Acceptable values are events_api, workflows, functions and tables. # @option options [string] :cursor # Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail. # @option options [integer] :limit @@ -26,11 +26,11 @@ module AdminAppsActivities # @option options [integer] :min_date_created # The earliest timestamp of the log to retrieve (epoch microseconds). # @option options [string] :min_log_level - # The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal'). + # The minimum log level of the log events to be returned. Defaults to info. Acceptable values (in order of relative importance from smallest to largest) are trace, debug, info, warn, error and fatal. # @option options [string] :sort_direction # The direction you want the data sorted by (always by timestamp). # @option options [string] :source - # The source of log events to be returned. Acceptable values are ('slack', 'developer'). + # The source of log events to be returned. Acceptable values are slack and developer. # @option options [string] :team_id # The team who owns this log. # @option options [string] :trace_id diff --git a/lib/slack/web/api/endpoints/admin_apps_config.rb b/lib/slack/web/api/endpoints/admin_apps_config.rb index a1cb382f..ed9f2565 100644 --- a/lib/slack/web/api/endpoints/admin_apps_config.rb +++ b/lib/slack/web/api/endpoints/admin_apps_config.rb @@ -24,9 +24,9 @@ def admin_apps_config_lookup(options = {}) # @option options [Object] :app_id # The encoded app ID to set the app config for. # @option options [object] :domain_restrictions - # Domain restrictions for the app. + # Domain restrictions for the app. Should be an object with two properties: urls and emails. Each is an array of strings, and each sets the allowed URLs and emails for connector authorization, respectively. # @option options [string] :workflow_auth_strategy - # The workflow auth permission. + # The workflow auth permission. Can be one of builder_choice or end_user_only. # @see https://api.slack.com/methods/admin.apps.config.set # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.config/admin.apps.config.set.json def admin_apps_config_set(options = {}) diff --git a/lib/slack/web/api/endpoints/admin_conversations.rb b/lib/slack/web/api/endpoints/admin_conversations.rb index 6431d5b4..325b494f 100644 --- a/lib/slack/web/api/endpoints/admin_conversations.rb +++ b/lib/slack/web/api/endpoints/admin_conversations.rb @@ -264,6 +264,8 @@ def admin_conversations_rename(options = {}) # Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a). # @option options [array] :team_ids # Comma separated string of team IDs, signifying the internal workspaces to search through. + # @option options [boolean] :total_count_only + # Only return the total_count of channels. Omits channel data and allows access for admins without channel manager permissions. # @see https://api.slack.com/methods/admin.conversations.search # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.search.json def admin_conversations_search(options = {}) diff --git a/lib/slack/web/api/endpoints/admin_users.rb b/lib/slack/web/api/endpoints/admin_users.rb index 7ff147b6..6b04d034 100644 --- a/lib/slack/web/api/endpoints/admin_users.rb +++ b/lib/slack/web/api/endpoints/admin_users.rb @@ -64,6 +64,10 @@ def admin_users_invite(options = {}) # # @option options [string] :cursor # Set cursor to next_cursor returned by the previous call to list items in the next page. + # @option options [boolean] :include_deactivated_workspaces + # Only applies with org token and no team_id. If true, both active and deactivated workspaces are returned for a user in workspaces. If false, only active workspaces are returned for a user in workspaces. Default is false. + # @option options [boolean] :is_active + # If true, only active users will be returned. If false, only deactivated users will be returned. Default is true. # @option options [integer] :limit # Limit for how many users to be retrieved per page. # @option options [Object] :team_id diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 4f5f7ab8..7c728f58 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -156,6 +156,8 @@ def chat_postEphemeral(options = {}) # Change how messages are treated. See below. # @option options [boolean] :reply_broadcast # Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false. + # @option options [string] :service_team_id + # For a message posted in App Home, Team ID corresponding to the selected app installation. # @option options [string] :thread_ts # Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead. # @option options [boolean] :unfurl_links @@ -256,7 +258,7 @@ def chat_unfurl(options = {}) # @option options [string] :attachments # A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field. # @option options [blocks[] as string] :blocks - # A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field. + # A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will only be retained if the text argument is not provided. If the text argument is provided and blocks are not provided, the blocks will be unset. To remove previous blocks, include an empty array for this field. # @option options [array] :file_ids # Array of new file ids that will be sent with this message. # @option options [boolean] :link_names @@ -268,7 +270,7 @@ def chat_unfurl(options = {}) # @option options [boolean] :reply_broadcast # Broadcast an existing thread reply to make it visible to everyone in the channel or conversation. # @option options [string] :text - # New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments. + # New text for the message, using the default formatting rules. This text, combined with either blocks or attachments, is used as fallback text for notifications. # @see https://api.slack.com/methods/chat.update # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json def chat_update(options = {}) diff --git a/lib/slack/web/api/endpoints/conversations.rb b/lib/slack/web/api/endpoints/conversations.rb index 0011ff13..8b74d6aa 100644 --- a/lib/slack/web/api/endpoints/conversations.rb +++ b/lib/slack/web/api/endpoints/conversations.rb @@ -232,7 +232,7 @@ def conversations_leave(options = {}) # @option options [boolean] :exclude_archived # Set to true to exclude archived 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 no larger than 1000. + # 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 under 1000. # @option options [string] :team_id # encoded team id to list channels in, required if token belongs to org-wide app. # @option options [string] :types diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index b8ede5b7..61ec07bf 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -240,6 +240,7 @@ class HasAlreadyConnectedToOrg < SlackError; end class HashConflict < SlackError; end class InactiveCall < SlackError; end class InactiveInvite < SlackError; end + class IncludeDeactivatedWorkspacesInvalid < SlackError; end class InsecureRequest < SlackError; end class InternalError < SlackError; end class InvalidAction < SlackError; end @@ -384,6 +385,7 @@ class MissingArgument < SlackError; end class MissingChannel < SlackError; end class MissingDialog < SlackError; end class MissingDuration < SlackError; end + class MissingFileData < SlackError; end class MissingPostType < SlackError; end class MissingProfileId < SlackError; end class MissingResource < SlackError; end @@ -855,6 +857,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'hash_conflict' => HashConflict, 'inactive_call' => InactiveCall, 'inactive_invite' => InactiveInvite, + 'include_deactivated_workspaces_invalid' => IncludeDeactivatedWorkspacesInvalid, 'insecure_request' => InsecureRequest, 'internal_error' => InternalError, 'invalid_action' => InvalidAction, @@ -999,6 +1002,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'missing_channel' => MissingChannel, 'missing_dialog' => MissingDialog, 'missing_duration' => MissingDuration, + 'missing_file_data' => MissingFileData, 'missing_post_type' => MissingPostType, 'missing_profile_id' => MissingProfileId, 'missing_resource' => MissingResource, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index d3eba1e6..ed75a3ed 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit d3eba1e6e06f1ea3f4f2eaaec832c68ff0163e78 +Subproject commit ed75a3edd348655f3ebf1d84481ff52bb488df5e