diff --git a/bin/commands/apps_auth_external.rb b/bin/commands/apps_auth_external.rb new file mode 100644 index 00000000..c104cb5e --- /dev/null +++ b/bin/commands/apps_auth_external.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'AppsAuthExternal methods.' + command 'apps_auth_external' do |g| + g.desc 'Delete external auth tokens only on the Slack side' + g.long_desc %( Delete external auth tokens only on the Slack side ) + g.command 'delete' do |c| + c.flag 'app_id', desc: 'The id of the app whose tokens you want to delete.' + c.flag 'external_token_id', desc: 'The id of the token that you want to delete.' + c.flag 'provider_key', desc: 'The provider key of the provider whose tokens you want to delete.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.apps_auth_external_delete(options)) + end + end + + g.desc 'Get the access token for the provided token ID' + g.long_desc %( Get the access token for the provided token ID ) + g.command 'get' do |c| + c.flag 'external_token_id', desc: 'The id of the token you want to get the token for.' + c.flag 'force_refresh', desc: 'Always refresh existing token before returning even when the token has not expired.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.apps_auth_external_get(options)) + end + end + end + end + end +end diff --git a/bin/commands/functions_workflows_steps.rb b/bin/commands/functions_workflows_steps.rb index 19ffda3f..eb4e63ff 100644 --- a/bin/commands/functions_workflows_steps.rb +++ b/bin/commands/functions_workflows_steps.rb @@ -9,8 +9,9 @@ class App g.desc "List the steps of a specific function of a workflow's versions" g.long_desc %( List the steps of a specific function of a workflow's versions ) g.command 'list' do |c| - c.flag 'function_id', desc: '.' + c.flag 'function_id', desc: 'The ID of the function to query.' c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.' + c.flag 'workflow_app_id', desc: 'The app tied to the workflow reference.' c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.' c.action do |_global_options, options, _args| puts JSON.dump(@client.functions_workflows_steps_list(options)) diff --git a/bin/commands/functions_workflows_steps_responses.rb b/bin/commands/functions_workflows_steps_responses.rb index 04bf9ffd..43b62ec8 100644 --- a/bin/commands/functions_workflows_steps_responses.rb +++ b/bin/commands/functions_workflows_steps_responses.rb @@ -9,8 +9,9 @@ class App g.desc 'Download form responses of a workflow' g.long_desc %( Download form responses of a workflow ) g.command 'export' do |c| - c.flag 'step_id', desc: '.' + c.flag 'step_id', desc: 'The ID of the OpenForm step to export.' c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.' + c.flag 'workflow_app_id', desc: 'The app tied to the workflow reference.' c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.' c.action do |_global_options, options, _args| puts JSON.dump(@client.functions_workflows_steps_responses_export(options)) diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index 379ef434..baf3d22a 100644 --- a/lib/slack/web/api/endpoints.rb +++ b/lib/slack/web/api/endpoints.rb @@ -27,6 +27,7 @@ require_relative 'endpoints/admin_users_unsupportedVersions' require_relative 'endpoints/api' require_relative 'endpoints/apps' +require_relative 'endpoints/apps_auth_external' require_relative 'endpoints/apps_connections' require_relative 'endpoints/apps_datastore' require_relative 'endpoints/apps_event_authorizations' @@ -105,6 +106,7 @@ module Endpoints include AdminUsersUnsupportedversions include Api include Apps + include AppsAuthExternal include AppsConnections include AppsDatastore include AppsEventAuthorizations diff --git a/lib/slack/web/api/endpoints/apps_auth_external.rb b/lib/slack/web/api/endpoints/apps_auth_external.rb new file mode 100644 index 00000000..193a3ac8 --- /dev/null +++ b/lib/slack/web/api/endpoints/apps_auth_external.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AppsAuthExternal + # + # Delete external auth tokens only on the Slack side + # + # @option options [string] :app_id + # The id of the app whose tokens you want to delete. + # @option options [string] :external_token_id + # The id of the token that you want to delete. + # @option options [string] :provider_key + # The provider key of the provider whose tokens you want to delete. + # @see https://api.slack.com/methods/apps.auth.external.delete + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.delete.json + def apps_auth_external_delete(options = {}) + post('apps.auth.external.delete', options) + end + + # + # Get the access token for the provided token ID + # + # @option options [string] :external_token_id + # The id of the token you want to get the token for. + # @option options [boolean] :force_refresh + # Always refresh existing token before returning even when the token has not expired. + # @see https://api.slack.com/methods/apps.auth.external.get + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.get.json + def apps_auth_external_get(options = {}) + raise ArgumentError, 'Required arguments :external_token_id missing' if options[:external_token_id].nil? + post('apps.auth.external.get', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/functions_workflows_steps.rb b/lib/slack/web/api/endpoints/functions_workflows_steps.rb index c75f74b5..2f7f8443 100644 --- a/lib/slack/web/api/endpoints/functions_workflows_steps.rb +++ b/lib/slack/web/api/endpoints/functions_workflows_steps.rb @@ -10,9 +10,11 @@ module FunctionsWorkflowsSteps # List the steps of a specific function of a workflow's versions # # @option options [string] :function_id - # . + # The ID of the function to query. # @option options [string] :workflow # The workflow encoded ID or workflow reference. + # @option options [string] :workflow_app_id + # The app tied to the workflow reference. # @option options [string] :workflow_id # The workflow ID, starts with Wf*. # @see https://api.slack.com/methods/functions.workflows.steps.list diff --git a/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb b/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb index 5500b03d..e6d435d1 100644 --- a/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +++ b/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb @@ -10,9 +10,11 @@ module FunctionsWorkflowsStepsResponses # Download form responses of a workflow # # @option options [string] :step_id - # . + # The ID of the OpenForm step to export. # @option options [string] :workflow # The workflow encoded ID or workflow reference. + # @option options [string] :workflow_app_id + # The app tied to the workflow reference. # @option options [string] :workflow_id # The workflow ID, starts with Wf*. # @see https://api.slack.com/methods/functions.workflows.steps.responses.export diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index e90a596e..1a0bdb23 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -81,7 +81,6 @@ class CannotPrompt < SlackError; end class CannotResetBot < SlackError; end class CannotResetPrimaryOwner < SlackError; end class CannotResolveAlias < SlackError; end - class CannotSetBothNumMinutesAndIsIndefinite < SlackError; end class CannotSetThisGuestToRegularAtTeamLevel < SlackError; end class CannotShareCrossWorkspaceChannel < SlackError; end class CannotShareMandatoryChannel < SlackError; end @@ -102,6 +101,7 @@ class CantLeaveGeneral < SlackError; end class CantUpdateMessage < SlackError; end class CanvasDisabledFileTeam < SlackError; end class CanvasDisabledUserTeam < SlackError; end + class CanvasGloballyDisabled < SlackError; end class ChannelArchived < SlackError; end class ChannelCannotBeUnshared < SlackError; end class ChannelCanvasDeleted < SlackError; end @@ -314,6 +314,7 @@ class InvalidTargetTeam < SlackError; end class InvalidTeam < SlackError; end class InvalidTeamId < SlackError; end class InvalidTeamIds < SlackError; end + class InvalidThreadTs < SlackError; end class InvalidTime < SlackError; end class InvalidTimestamp < SlackError; end class InvalidTitle < SlackError; end @@ -342,6 +343,7 @@ class InviteeCantSeeChannel < SlackError; end class InvitorCannotSeeChannel < SlackError; end class IsArchived < SlackError; end class IsBot < SlackError; end + class IsIdpManaged < SlackError; end class IsInactive < SlackError; end class IsPendingConnectedToOrg < SlackError; end class LastMember < SlackError; end @@ -355,6 +357,7 @@ class MalwareDetected < SlackError; end class ManagedChannelNotSupported < SlackError; end class MemberAnalyticsDisabled < SlackError; end class MemberLimitExceeded < SlackError; end + class MessageLimitExceeded < SlackError; end class MessageNotFound < SlackError; end class MessageTooLong < SlackError; end class MessagesTabDisabled < SlackError; end @@ -363,6 +366,7 @@ class MetadataNotAvailable < SlackError; end class MetadataOnlyDoesNotSupportDate < SlackError; end class MetadataTooLarge < SlackError; end class MethodDeprecated < SlackError; end + class MethodNotSupported < SlackError; end class MethodNotSupportedForChannelType < SlackError; end class MigrationInProgress < SlackError; end class MissingArgs < SlackError; end @@ -404,12 +408,14 @@ class NoLocalUserOnTeam < SlackError; end class NoPermission < SlackError; end class NoPin < SlackError; end class NoReaction < SlackError; end + class NoRefreshToken < SlackError; end class NoResolutionFound < SlackError; end class NoScopes < SlackError; end class NoSuchSubteam < SlackError; end class NoTeamIdsGiven < SlackError; end class NoTeamsToDisconnect < SlackError; end class NoText < SlackError; end + class NoTokensFound < SlackError; end class NoUser < SlackError; end class NoUsersProvided < SlackError; end class NoValidChannels < SlackError; end @@ -465,6 +471,7 @@ class PostingToGeneralChannelDenied < SlackError; end class PreviewFeatureNotAvailable < SlackError; end class PrimaryUsergroupNotFound < SlackError; end class ProfileSetFailed < SlackError; end + class ProvidersNotFound < SlackError; end class PublicVideoNotAllowed < SlackError; end class PublishedAppOnly < SlackError; end class PushLimitReached < SlackError; end @@ -496,7 +503,6 @@ class SlackConnectCanvasSharingBlocked < SlackError; end class SlackConnectClipSharingBlocked < SlackError; end class SlackConnectFileLinkSharingBlocked < SlackError; end class SlackConnectFileUploadSharingBlocked < SlackError; end - class SlackConnectTeamBlocked < SlackError; end class SnippetTooLarge < SlackError; end class SnoozeEndFailed < SlackError; end class SnoozeFailed < SlackError; end @@ -521,6 +527,7 @@ class TimeInPast < SlackError; end class TimeTooFar < SlackError; end class TokenAlreadyExchanged < SlackError; end class TokenExpired < SlackError; end + class TokenNotFound < SlackError; end class TokenRevoked < SlackError; end class TokenRotationNotEnabled < SlackError; end class TooLarge < SlackError; end @@ -547,6 +554,7 @@ class TooManyUsers < SlackError; end class TriggerExchanged < SlackError; end class TriggerExpired < SlackError; end class TwoFactorSetupRequired < SlackError; end + class UnableToDelete < SlackError; end class UnableToFetchCustomEmojis < SlackError; end class UnableToLinkIdpGroupAndChannel < SlackError; end class UnableToProcessPostRequest < SlackError; end @@ -671,7 +679,6 @@ class ViewTooLarge < SlackError; end 'cannot_reset_bot' => CannotResetBot, 'cannot_reset_primary_owner' => CannotResetPrimaryOwner, 'cannot_resolve_alias' => CannotResolveAlias, - 'cannot_set_both_num_minutes_and_is_indefinite' => CannotSetBothNumMinutesAndIsIndefinite, 'cannot_set_this_guest_to_regular_at_team_level' => CannotSetThisGuestToRegularAtTeamLevel, 'cannot_share_cross_workspace_channel' => CannotShareCrossWorkspaceChannel, 'cannot_share_mandatory_channel' => CannotShareMandatoryChannel, @@ -692,6 +699,7 @@ class ViewTooLarge < SlackError; end 'cant_update_message' => CantUpdateMessage, 'canvas_disabled_file_team' => CanvasDisabledFileTeam, 'canvas_disabled_user_team' => CanvasDisabledUserTeam, + 'canvas_globally_disabled' => CanvasGloballyDisabled, 'channel_archived' => ChannelArchived, 'channel_cannot_be_unshared' => ChannelCannotBeUnshared, 'channel_canvas_deleted' => ChannelCanvasDeleted, @@ -904,6 +912,7 @@ class ViewTooLarge < SlackError; end 'invalid_team' => InvalidTeam, 'invalid_team_id' => InvalidTeamId, 'invalid_team_ids' => InvalidTeamIds, + 'invalid_thread_ts' => InvalidThreadTs, 'invalid_time' => InvalidTime, 'invalid_timestamp' => InvalidTimestamp, 'invalid_title' => InvalidTitle, @@ -932,6 +941,7 @@ class ViewTooLarge < SlackError; end 'invitor_cannot_see_channel' => InvitorCannotSeeChannel, 'is_archived' => IsArchived, 'is_bot' => IsBot, + 'is_idp_managed' => IsIdpManaged, 'is_inactive' => IsInactive, 'is_pending_connected_to_org' => IsPendingConnectedToOrg, 'last_member' => LastMember, @@ -945,6 +955,7 @@ class ViewTooLarge < SlackError; end 'managed_channel_not_supported' => ManagedChannelNotSupported, 'member_analytics_disabled' => MemberAnalyticsDisabled, 'member_limit_exceeded' => MemberLimitExceeded, + 'message_limit_exceeded' => MessageLimitExceeded, 'message_not_found' => MessageNotFound, 'message_too_long' => MessageTooLong, 'messages_tab_disabled' => MessagesTabDisabled, @@ -953,6 +964,7 @@ class ViewTooLarge < SlackError; end 'metadata_only_does_not_support_date' => MetadataOnlyDoesNotSupportDate, 'metadata_too_large' => MetadataTooLarge, 'method_deprecated' => MethodDeprecated, + 'method_not_supported' => MethodNotSupported, 'method_not_supported_for_channel_type' => MethodNotSupportedForChannelType, 'migration_in_progress' => MigrationInProgress, 'missing_args' => MissingArgs, @@ -994,12 +1006,14 @@ class ViewTooLarge < SlackError; end 'no_permission' => NoPermission, 'no_pin' => NoPin, 'no_reaction' => NoReaction, + 'no_refresh_token' => NoRefreshToken, 'no_resolution_found' => NoResolutionFound, 'no_scopes' => NoScopes, 'no_such_subteam' => NoSuchSubteam, 'no_team_ids_given' => NoTeamIdsGiven, 'no_teams_to_disconnect' => NoTeamsToDisconnect, 'no_text' => NoText, + 'no_tokens_found' => NoTokensFound, 'no_user' => NoUser, 'no_users_provided' => NoUsersProvided, 'no_valid_channels' => NoValidChannels, @@ -1055,6 +1069,7 @@ class ViewTooLarge < SlackError; end 'preview_feature_not_available' => PreviewFeatureNotAvailable, 'primary_usergroup_not_found' => PrimaryUsergroupNotFound, 'profile_set_failed' => ProfileSetFailed, + 'providers_not_found' => ProvidersNotFound, 'public_video_not_allowed' => PublicVideoNotAllowed, 'published_app_only' => PublishedAppOnly, 'push_limit_reached' => PushLimitReached, @@ -1086,7 +1101,6 @@ class ViewTooLarge < SlackError; end 'slack_connect_clip_sharing_blocked' => SlackConnectClipSharingBlocked, 'slack_connect_file_link_sharing_blocked' => SlackConnectFileLinkSharingBlocked, 'slack_connect_file_upload_sharing_blocked' => SlackConnectFileUploadSharingBlocked, - 'slack_connect_team_blocked' => SlackConnectTeamBlocked, 'snippet_too_large' => SnippetTooLarge, 'snooze_end_failed' => SnoozeEndFailed, 'snooze_failed' => SnoozeFailed, @@ -1111,6 +1125,7 @@ class ViewTooLarge < SlackError; end 'time_too_far' => TimeTooFar, 'token_already_exchanged' => TokenAlreadyExchanged, 'token_expired' => TokenExpired, + 'token_not_found' => TokenNotFound, 'token_revoked' => TokenRevoked, 'token_rotation_not_enabled' => TokenRotationNotEnabled, 'too_large' => TooLarge, @@ -1137,6 +1152,7 @@ class ViewTooLarge < SlackError; end 'trigger_exchanged' => TriggerExchanged, 'trigger_expired' => TriggerExpired, 'two_factor_setup_required' => TwoFactorSetupRequired, + 'unable_to_delete' => UnableToDelete, 'unable_to_fetch_custom_emojis' => UnableToFetchCustomEmojis, 'unable_to_link_idp_group_and_channel' => UnableToLinkIdpGroupAndChannel, 'unable_to_process_post_request' => UnableToProcessPostRequest, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 878be8fe..d810a47b 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 878be8fe506e4bde7254ed8a2949e3712e72f9a1 +Subproject commit d810a47bb71b9f494e5b6d22cfe289a35998afa3 diff --git a/spec/slack/web/api/endpoints/apps_auth_external_spec.rb b/spec/slack/web/api/endpoints/apps_auth_external_spec.rb new file mode 100644 index 00000000..8f45d51a --- /dev/null +++ b/spec/slack/web/api/endpoints/apps_auth_external_spec.rb @@ -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::AppsAuthExternal do + let(:client) { Slack::Web::Client.new } + context 'apps.auth.external_get' do + it 'requires external_token_id' do + expect { client.apps_auth_external_get }.to raise_error ArgumentError, /Required arguments :external_token_id missing/ + end + end +end