Skip to content

Commit fb65305

Browse files
authored
Merge pull request #465 from slack-ruby/automated-api-update
Update API from slack-api-ref@878be8f
2 parents 097b3ca + b6a1ccb commit fb65305

17 files changed

+139
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [#454](https://github.com/slack-ruby/slack-ruby-client/pull/454): Added `Slack::Messages::Formatting#escape` - [@marfoldi](https://github.com/marfoldi).
66
* [#452](https://github.com/slack-ruby/slack-ruby-client/pull/452): Automatically generate Web API multi-argument requirements from docs - [@jmanian](https://github.com/jmanian).
77
* [#448](https://github.com/slack-ruby/slack-ruby-client/pull/448), [#453](https://github.com/slack-ruby/slack-ruby-client/pull/453): Automatically convert more Web API arguments to JSON-encoded strings - [@jmanian](https://github.com/jmanian).
8+
* [#465](https://github.com/slack-ruby-client/pulls/465): Update API from [slack-api-ref@878be8f](https://github.com/slack-ruby/slack-api-ref/commit/878be8f) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
89
* Your contribution here.
910

1011
### 2.1.0 (2023/03/17)

bin/commands/apps_auth_external.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
module Slack
5+
module Cli
6+
class App
7+
desc 'AppsAuthExternal methods.'
8+
command 'apps_auth_external' do |g|
9+
g.desc 'Delete external auth tokens only on the Slack side'
10+
g.long_desc %( Delete external auth tokens only on the Slack side )
11+
g.command 'delete' do |c|
12+
c.flag 'app_id', desc: 'The id of the app whose tokens you want to delete.'
13+
c.flag 'external_token_id', desc: 'The id of the token that you want to delete.'
14+
c.flag 'provider_key', desc: 'The provider key of the provider whose tokens you want to delete.'
15+
c.action do |_global_options, options, _args|
16+
puts JSON.dump(@client.apps_auth_external_delete(options))
17+
end
18+
end
19+
20+
g.desc 'Get the access token for the provided token ID'
21+
g.long_desc %( Get the access token for the provided token ID )
22+
g.command 'get' do |c|
23+
c.flag 'external_token_id', desc: 'The id of the token you want to get the token for.'
24+
c.flag 'force_refresh', desc: 'Always refresh existing token before returning even when the token has not expired.'
25+
c.action do |_global_options, options, _args|
26+
puts JSON.dump(@client.apps_auth_external_get(options))
27+
end
28+
end
29+
end
30+
end
31+
end
32+
end

bin/commands/chat.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ class App
6868
c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
6969
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
7070
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
71-
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
72-
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
71+
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.'
72+
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
7373
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
7474
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
7575
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."
76-
c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
76+
c.flag 'username', desc: "Set your bot's user name."
7777
c.action do |_global_options, options, _args|
7878
puts JSON.dump(@client.chat_postEphemeral(options))
7979
end
@@ -87,8 +87,8 @@ class App
8787
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
8888
c.flag 'text', desc: 'The formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.'
8989
c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic Slack apps. See authorship below.'
90-
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
91-
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
90+
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.'
91+
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
9292
c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
9393
c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
9494
c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
@@ -97,7 +97,7 @@ class App
9797
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."
9898
c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
9999
c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
100-
c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
100+
c.flag 'username', desc: "Set your bot's user name."
101101
c.action do |_global_options, options, _args|
102102
puts JSON.dump(@client.chat_postMessage(options))
103103
end

bin/commands/functions_workflows_steps.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class App
99
g.desc "List the steps of a specific function of a workflow's versions"
1010
g.long_desc %( List the steps of a specific function of a workflow's versions )
1111
g.command 'list' do |c|
12-
c.flag 'function_id', desc: '.'
12+
c.flag 'function_id', desc: 'The ID of the function to query.'
1313
c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.'
14+
c.flag 'workflow_app_id', desc: 'The app tied to the workflow reference.'
1415
c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.'
1516
c.action do |_global_options, options, _args|
1617
puts JSON.dump(@client.functions_workflows_steps_list(options))

bin/commands/functions_workflows_steps_responses.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class App
99
g.desc 'Download form responses of a workflow'
1010
g.long_desc %( Download form responses of a workflow )
1111
g.command 'export' do |c|
12-
c.flag 'step_id', desc: '.'
12+
c.flag 'step_id', desc: 'The ID of the OpenForm step to export.'
1313
c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.'
14+
c.flag 'workflow_app_id', desc: 'The app tied to the workflow reference.'
1415
c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.'
1516
c.action do |_global_options, options, _args|
1617
puts JSON.dump(@client.functions_workflows_steps_responses_export(options))

bin/commands/stars.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class App
1818
end
1919
end
2020

21-
g.desc "List a user's saved items, formerly known as _stars_."
22-
g.long_desc %( List a user's saved items, formerly known as _stars_. )
21+
g.desc "List a user's saved items, formerly known as stars."
22+
g.long_desc %( List a user's saved items, formerly known as stars. )
2323
g.command 'list' do |c|
2424
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
2525
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."

bin/commands/users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class App
1111
g.command 'conversations' do |c|
1212
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."
1313
c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
14-
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."
14+
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."
1515
c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.'
1616
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.'
1717
c.flag 'user', desc: "Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership."

lib/slack/web/api/endpoints.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
require_relative 'endpoints/admin_users_unsupportedVersions'
2828
require_relative 'endpoints/api'
2929
require_relative 'endpoints/apps'
30+
require_relative 'endpoints/apps_auth_external'
3031
require_relative 'endpoints/apps_connections'
3132
require_relative 'endpoints/apps_datastore'
3233
require_relative 'endpoints/apps_event_authorizations'
@@ -105,6 +106,7 @@ module Endpoints
105106
include AdminUsersUnsupportedversions
106107
include Api
107108
include Apps
109+
include AppsAuthExternal
108110
include AppsConnections
109111
include AppsDatastore
110112
include AppsEventAuthorizations
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
module Slack
5+
module Web
6+
module Api
7+
module Endpoints
8+
module AppsAuthExternal
9+
#
10+
# Delete external auth tokens only on the Slack side
11+
#
12+
# @option options [string] :app_id
13+
# The id of the app whose tokens you want to delete.
14+
# @option options [string] :external_token_id
15+
# The id of the token that you want to delete.
16+
# @option options [string] :provider_key
17+
# The provider key of the provider whose tokens you want to delete.
18+
# @see https://api.slack.com/methods/apps.auth.external.delete
19+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.delete.json
20+
def apps_auth_external_delete(options = {})
21+
post('apps.auth.external.delete', options)
22+
end
23+
24+
#
25+
# Get the access token for the provided token ID
26+
#
27+
# @option options [string] :external_token_id
28+
# The id of the token you want to get the token for.
29+
# @option options [boolean] :force_refresh
30+
# Always refresh existing token before returning even when the token has not expired.
31+
# @see https://api.slack.com/methods/apps.auth.external.get
32+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.get.json
33+
def apps_auth_external_get(options = {})
34+
raise ArgumentError, 'Required arguments :external_token_id missing' if options[:external_token_id].nil?
35+
post('apps.auth.external.get', options)
36+
end
37+
end
38+
end
39+
end
40+
end
41+
end

lib/slack/web/api/endpoints/chat.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ def chat_meMessage(options = {})
107107
# @option options [blocks[] as string] :blocks
108108
# A JSON-based array of structured blocks, presented as a URL-encoded string.
109109
# @option options [string] :icon_emoji
110-
# Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
110+
# Emoji to use as the icon for this message. Overrides icon_url.
111111
# @option options [string] :icon_url
112-
# URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
112+
# URL to an image to use as the icon for this message.
113113
# @option options [boolean] :link_names
114114
# Find and link channel names and usernames.
115115
# @option options [string] :parse
116116
# Change how messages are treated. Defaults to none. See below.
117117
# @option options [string] :thread_ts
118118
# 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.
119119
# @option options [string] :username
120-
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
120+
# Set your bot's user name.
121121
# @see https://api.slack.com/methods/chat.postEphemeral
122122
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
123123
def chat_postEphemeral(options = {})
@@ -143,9 +143,9 @@ def chat_postEphemeral(options = {})
143143
# @option options [boolean] :as_user
144144
# (Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic Slack apps. See authorship below.
145145
# @option options [string] :icon_emoji
146-
# Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
146+
# Emoji to use as the icon for this message. Overrides icon_url.
147147
# @option options [string] :icon_url
148-
# URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
148+
# URL to an image to use as the icon for this message.
149149
# @option options [boolean] :link_names
150150
# Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.
151151
# @option options [string] :metadata
@@ -163,7 +163,7 @@ def chat_postEphemeral(options = {})
163163
# @option options [boolean] :unfurl_media
164164
# Pass false to disable unfurling of media content.
165165
# @option options [string] :username
166-
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
166+
# Set your bot's user name.
167167
# @see https://api.slack.com/methods/chat.postMessage
168168
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
169169
def chat_postMessage(options = {})

0 commit comments

Comments
 (0)