slack-ruby-client 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/integration_test.yml +1 -1
  4. data/.github/workflows/lint.yml +1 -1
  5. data/.github/workflows/pr_lint.yml +1 -1
  6. data/.github/workflows/test.yml +1 -1
  7. data/.github/workflows/update_api.yml +8 -3
  8. data/CHANGELOG.md +7 -0
  9. data/README.md +2 -2
  10. data/bin/commands/admin_apps_activities.rb +4 -4
  11. data/bin/commands/admin_apps_config.rb +2 -2
  12. data/bin/commands/admin_conversations.rb +2 -1
  13. data/bin/commands/admin_users.rb +2 -0
  14. data/bin/commands/chat.rb +9 -9
  15. data/bin/commands/conversations.rb +2 -1
  16. data/bin/commands/functions.rb +31 -0
  17. data/bin/commands/pins.rb +0 -1
  18. data/bin/commands/team.rb +2 -2
  19. data/bin/commands/usergroups.rb +10 -10
  20. data/bin/commands/usergroups_users.rb +8 -8
  21. data/lib/slack/events/request.rb +4 -2
  22. data/lib/slack/version.rb +1 -1
  23. data/lib/slack/web/api/endpoints/admin_apps_activities.rb +5 -5
  24. data/lib/slack/web/api/endpoints/admin_apps_config.rb +3 -3
  25. data/lib/slack/web/api/endpoints/admin_conversations.rb +3 -1
  26. data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +1 -1
  27. data/lib/slack/web/api/endpoints/admin_users.rb +4 -0
  28. data/lib/slack/web/api/endpoints/admin_workflows.rb +3 -3
  29. data/lib/slack/web/api/endpoints/apps_activities.rb +1 -1
  30. data/lib/slack/web/api/endpoints/chat.rb +21 -21
  31. data/lib/slack/web/api/endpoints/conversations.rb +3 -1
  32. data/lib/slack/web/api/endpoints/functions.rb +43 -0
  33. data/lib/slack/web/api/endpoints/openid_connect.rb +1 -1
  34. data/lib/slack/web/api/endpoints/pins.rb +0 -2
  35. data/lib/slack/web/api/endpoints/search.rb +3 -3
  36. data/lib/slack/web/api/endpoints/team.rb +3 -3
  37. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  38. data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
  39. data/lib/slack/web/api/endpoints/usergroups_users.rb +6 -6
  40. data/lib/slack/web/api/endpoints/users.rb +1 -1
  41. data/lib/slack/web/api/endpoints.rb +2 -0
  42. data/lib/slack/web/api/errors.rb +14 -0
  43. data/lib/slack/web/api/patches/.gitkeep +0 -0
  44. data/spec/slack/events/request_spec.rb +11 -0
  45. data/spec/slack/web/api/endpoints/chat_spec.rb +76 -4
  46. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +2 -9
  47. data/spec/slack/web/api/endpoints/functions_spec.rb +28 -0
  48. metadata +7 -3
  49. data/lib/slack/web/api/patches/chat.attachments-blocks.patch +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88d9fc4c82be7eb365f184eb9be4babf355c4422e7aa981a669c68df866fcd89
4
- data.tar.gz: 6380fa106f4b05359bc4b0e8598aa02a4f2ab2bd6f31ff5fdb5f2e356c2ee76f
3
+ metadata.gz: 7dd6a8acd792da60c4f03242bea5e978f0aefa04cef7cd1884eeb0e61c2ea15a
4
+ data.tar.gz: a55940551456236d78faa93b93cad4704de07117f3e295c08a0dcf31582a176a
5
5
  SHA512:
6
- metadata.gz: 8d41b9da28c2e14c25567e4ab620779095cc0c0f12b633937e4e4f2aa7c69b482f13cb1b9ad0353576cd2f2bd1d8c710680115b70f2fae2ef68488b334ee759e
7
- data.tar.gz: 1ac12afca5aa38457b9fc72da39662e0b301fa2fd4ffc7d5aefddca62dc7c5988193104356e4a5b16a8c6b9ec0b28adce52f7ceda2486982c85e7eba07fbfcac
6
+ metadata.gz: 3baa04a2834d3a1a0483708b9521cec7b1e6cc914b526bdfa064f3f065fcbb7b728b56b87c0dc43087f7e2f6e54e19949b0d1f3e6efa95f31c4bdfc285e22b97
7
+ data.tar.gz: 8eef87ae2c4eed1e877136a518614de11f2f7ff86019f329ddc3165726a1ef06bde0da4648915fb5c15dc2ebd1ea4aa43f358cc75667d77612782edc8f88ce50
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -27,7 +27,7 @@ jobs:
27
27
  name: test (ruby=${{ matrix.entry.ruby }}, concurrency=${{ matrix.entry.concurrency || 'none' }})
28
28
  steps:
29
29
  - name: Checkout
30
- uses: actions/checkout@v3
30
+ uses: actions/checkout@v4
31
31
  - name: Set up Ruby
32
32
  uses: ruby/setup-ruby@v1
33
33
  with:
@@ -6,7 +6,7 @@ jobs:
6
6
  runs-on: ubuntu-latest
7
7
  steps:
8
8
  - name: Checkout
9
- uses: actions/checkout@v3
9
+ uses: actions/checkout@v4
10
10
  - name: Set up Ruby
11
11
  uses: ruby/setup-ruby@v1
12
12
  with:
@@ -8,7 +8,7 @@ jobs:
8
8
  BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger
9
9
  steps:
10
10
  - name: Checkout
11
- uses: actions/checkout@v3
11
+ uses: actions/checkout@v4
12
12
  with:
13
13
  fetch-depth: 0
14
14
  - name: Set up Ruby
@@ -16,7 +16,7 @@ jobs:
16
16
  name: test (ruby=${{ matrix.entry.ruby }}, concurrency=${{ matrix.entry.concurrency || 'none' }})
17
17
  steps:
18
18
  - name: Checkout
19
- uses: actions/checkout@v3
19
+ uses: actions/checkout@v4
20
20
  - name: Set up Ruby
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
@@ -11,7 +11,7 @@ jobs:
11
11
  contents: write
12
12
  pull-requests: write
13
13
  steps:
14
- - uses: actions/checkout@v3
14
+ - uses: actions/checkout@v4
15
15
  with:
16
16
  submodules: recursive
17
17
  fetch-depth: 0
@@ -35,14 +35,14 @@ jobs:
35
35
  - name: GitHub App token
36
36
  if: ${{ github.repository == 'slack-ruby/slack-ruby-client' }}
37
37
  id: github_app_token
38
- uses: tibdex/github-app-token@v1.6.0
38
+ uses: tibdex/github-app-token@v2.1.0
39
39
  with:
40
40
  app_id: ${{ secrets.CI_APP_ID }}
41
41
  private_key: ${{ secrets.CI_APP_PRIVATE_KEY }}
42
42
  installation_id: 36985419
43
43
  - name: Create pull request
44
44
  id: cpr
45
- uses: peter-evans/create-pull-request@v4
45
+ uses: peter-evans/create-pull-request@v5
46
46
  with:
47
47
  token: ${{ secrets.GITHUB_TOKEN }}
48
48
  commit-message: Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }} (${{ steps.date.outputs.date }})
@@ -55,6 +55,11 @@ jobs:
55
55
  base: master
56
56
  committer: slack-ruby-ci-bot <noreply@github.com>
57
57
  author: slack-ruby-ci-bot <noreply@github.com>
58
+ - name: Check out update branch
59
+ if: ${{ steps.cpr.outputs.pull-request-number != '' }}
60
+ run: |
61
+ git fetch origin automated-api-update
62
+ git checkout automated-api-update
58
63
  - name: Update CHANGELOG
59
64
  uses: jacobtomlinson/gha-find-replace@v3
60
65
  if: ${{ steps.cpr.outputs.pull-request-number != '' }}
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 2.3.0 (2024/01/31)
2
+
3
+ * [#494](https://github.com/slack-ruby/slack-ruby-client/pull/494): Configure Dependabot to update GitHub Actions - [@olleolleolle](https://github.com/olleolleolle).
4
+ * [#508](https://github.com/slack-ruby/slack-ruby-client/pull/508): Fix `Slack::Events::Request#verify!` compatibility with Rack 3.x - [@dblock](https://github.com/dblock).
5
+ * [#503](https://github.com/slack-ruby/slack-ruby-client/pull/503): Update Slack API Update API from [slack-api-ref@bc545649](https://github.com/slack-ruby/slack-api-ref/commit/bc545649) - [@dblock](https://github.com/dblock).
6
+ * [#504](https://github.com/slack-ruby-client/pulls/504): Update API from [slack-api-ref@bc54564](https://github.com/slack-ruby/slack-api-ref/commit/bc54564) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
7
+
1
8
  ### 2.2.0 (2023/09/17)
2
9
 
3
10
  * [#458](https://github.com/slack-ruby/slack-ruby-client/pull/458): Add workflow for automatic API updates - [@duffn](https://github.com/duffn).
data/README.md CHANGED
@@ -81,7 +81,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
81
81
 
82
82
  ## Stable Release
83
83
 
84
- You're reading the documentation for the **stable** release of slack-ruby-client, 2.2.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
84
+ You're reading the documentation for the **stable** release of slack-ruby-client, 2.3.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
85
85
 
86
86
  ## Installation
87
87
 
@@ -177,7 +177,7 @@ Upload a file with [files_upload](https://api.slack.com/methods/files.upload).
177
177
  client.files_upload(
178
178
  channels: '#general',
179
179
  as_user: true,
180
- file: Faraday::UploadIO.new('/path/to/avatar.jpg', 'image/jpeg'),
180
+ file: Faraday::Multipart::FilePart.new('/path/to/avatar.jpg', 'image/jpeg'),
181
181
  title: 'My Avatar',
182
182
  filename: 'avatar.jpg',
183
183
  initial_comment: 'Attached a selfie.'
@@ -10,16 +10,16 @@ module Slack
10
10
  g.long_desc %( Get logs for a specified team/org )
11
11
  g.command 'list' do |c|
12
12
  c.flag 'app_id', desc: 'The ID of the app to get activities from.'
13
- c.flag 'component_id', desc: "The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows."
14
- c.flag 'component_type', desc: "The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables')."
13
+ c.flag 'component_id', desc: 'The component ID of log events to be returned. Will be FnXXXXXX for functions, and WfXXXXXX for worflows.'
14
+ c.flag 'component_type', desc: 'The component type of log events to be returned. Acceptable values are events_api, workflows, functions and tables.'
15
15
  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."
16
16
  c.flag 'limit', desc: 'The maximum number of items to return.'
17
17
  c.flag 'log_event_type', desc: 'The event type of log events to be returned.'
18
18
  c.flag 'max_date_created', desc: 'The latest timestamp of the log to retrieve (epoch microseconds).'
19
19
  c.flag 'min_date_created', desc: 'The earliest timestamp of the log to retrieve (epoch microseconds).'
20
- 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')."
20
+ 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.'
21
21
  c.flag 'sort_direction', desc: 'The direction you want the data sorted by (always by timestamp).'
22
- c.flag 'source', desc: "The source of log events to be returned. Acceptable values are ('slack', 'developer')."
22
+ c.flag 'source', desc: 'The source of log events to be returned. Acceptable values are slack and developer.'
23
23
  c.flag 'team_id', desc: 'The team who owns this log.'
24
24
  c.flag 'trace_id', desc: 'The trace ID of log events to be returned.'
25
25
  c.action do |_global_options, options, _args|
@@ -19,8 +19,8 @@ module Slack
19
19
  g.long_desc %( Set the app config for a connector )
20
20
  g.command 'set' do |c|
21
21
  c.flag 'app_id', desc: 'The encoded app ID to set the app config for.'
22
- c.flag 'domain_restrictions', desc: 'Domain restrictions for the app.'
23
- c.flag 'workflow_auth_strategy', desc: 'The workflow auth permission.'
22
+ 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.'
23
+ c.flag 'workflow_auth_strategy', desc: 'The workflow auth permission. Can be one of builder_choice or end_user_only.'
24
24
  c.action do |_global_options, options, _args|
25
25
  puts JSON.dump(@client.admin_apps_config_set(options))
26
26
  end
@@ -18,7 +18,7 @@ module Slack
18
18
  g.desc 'Archive public or private channels in bulk.'
19
19
  g.long_desc %( Archive public or private channels in bulk. )
20
20
  g.command 'bulkArchive' do |c|
21
- c.flag 'channel_ids', desc: 'An array of channel IDs to archive.'
21
+ c.flag 'channel_ids', desc: 'An array of channel IDs to archive. No more than 100 items are allowed.'
22
22
  c.action do |_global_options, options, _args|
23
23
  puts JSON.dump(@client.admin_conversations_bulkArchive(options))
24
24
  end
@@ -176,6 +176,7 @@ module Slack
176
176
  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.'
177
177
  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).'
178
178
  c.flag 'team_ids', desc: 'Comma separated string of team IDs, signifying the internal workspaces to search through.'
179
+ 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.'
179
180
  c.action do |_global_options, options, _args|
180
181
  puts JSON.dump(@client.admin_conversations_search(options))
181
182
  end
@@ -41,6 +41,8 @@ module Slack
41
41
  g.long_desc %( List users on a workspace )
42
42
  g.command 'list' do |c|
43
43
  c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
44
+ c.flag 'include_deactivated_user_workspaces', desc: 'Only applies with org token and no team_id. If true, return workspaces for a user even if they may be deactivated on them. If false, return workspaces for a user only when user is active on them. Default is false.'
45
+ c.flag 'is_active', desc: 'If true, only active users will be returned. If false, only deactivated users will be returned. Default is true.'
44
46
  c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.'
45
47
  c.flag 'team_id', desc: 'The ID (T1234) of the workspace. The team_id is required if you use an org-level token.'
46
48
  c.action do |_global_options, options, _args|
data/bin/commands/chat.rb CHANGED
@@ -63,11 +63,11 @@ module Slack
63
63
  g.long_desc %( Sends an ephemeral message to a user in a channel. )
64
64
  g.command 'postEphemeral' do |c|
65
65
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
66
- 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.'
67
66
  c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
68
- 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.'
69
67
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
70
68
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
69
+ 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.'
70
+ 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.'
71
71
  c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.'
72
72
  c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
73
73
  c.flag 'link_names', desc: 'Find and link channel names and usernames.'
@@ -85,7 +85,7 @@ module Slack
85
85
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
86
86
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
87
87
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
88
- 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.'
88
+ 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.'
89
89
  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
90
  c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.'
91
91
  c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
@@ -107,11 +107,11 @@ module Slack
107
107
  g.long_desc %( Schedules a message to be sent to a channel. )
108
108
  g.command 'scheduleMessage' do |c|
109
109
  c.flag 'channel', desc: 'Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
110
- c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
111
- 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.'
112
- c.flag 'as_user', desc: 'Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.'
110
+ c.flag 'post_at', desc: 'Unix timestamp representing the future time the message should post to Slack.'
113
111
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
114
112
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
113
+ 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.'
114
+ c.flag 'as_user', desc: 'Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.'
115
115
  c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
116
116
  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.'
117
117
  c.flag 'parse', desc: 'Change how messages are treated. See chat.postMessage.'
@@ -146,15 +146,15 @@ module Slack
146
146
  g.command 'update' do |c|
147
147
  c.flag 'channel', desc: 'Channel containing the message to be updated.'
148
148
  c.flag 'ts', desc: 'Timestamp of the message to be updated.'
149
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
150
+ c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
151
+ 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.'
149
152
  c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
150
- 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."
151
- 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."
152
153
  c.flag 'file_ids', desc: 'Array of new file ids that will be sent with this message.'
153
154
  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.'
154
155
  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."
155
156
  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.'
156
157
  c.flag 'reply_broadcast', desc: 'Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.'
157
- c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments."
158
158
  c.action do |_global_options, options, _args|
159
159
  puts JSON.dump(@client.chat_update(options))
160
160
  end
@@ -100,6 +100,7 @@ module Slack
100
100
  g.command 'invite' do |c|
101
101
  c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
102
102
  c.flag 'users', desc: 'A comma separated list of user IDs. Up to 1000 users may be listed.'
103
+ c.flag 'force', desc: 'When set to true and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to false.'
103
104
  c.action do |_global_options, options, _args|
104
105
  puts JSON.dump(@client.conversations_invite(options))
105
106
  end
@@ -150,7 +151,7 @@ module Slack
150
151
  g.command 'list' do |c|
151
152
  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."
152
153
  c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
153
- 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."
154
+ 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."
154
155
  c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.'
155
156
  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.'
156
157
  c.action do |_global_options, options, _args|
@@ -0,0 +1,31 @@
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 'Functions methods.'
8
+ command 'functions' do |g|
9
+ g.desc 'Signal that a function failed to complete'
10
+ g.long_desc %( Signal that a function failed to complete )
11
+ g.command 'completeError' do |c|
12
+ c.flag 'error', desc: 'A human-readable error message that contains information about why the function failed to complete.'
13
+ c.flag 'function_execution_id', desc: 'Context identifier that maps to the executed function.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.functions_completeError(options))
16
+ end
17
+ end
18
+
19
+ g.desc 'Signal the successful completion of a function'
20
+ g.long_desc %( Signal the successful completion of a function )
21
+ g.command 'completeSuccess' do |c|
22
+ c.flag 'function_execution_id', desc: 'Context identifier that maps to the executed function.'
23
+ c.flag 'outputs', desc: 'A JSON-based object that conforms to the output parameters schema for the custom function defined in the manifest.'
24
+ c.action do |_global_options, options, _args|
25
+ puts JSON.dump(@client.functions_completeSuccess(options))
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
data/bin/commands/pins.rb CHANGED
@@ -10,7 +10,6 @@ module Slack
10
10
  g.long_desc %( Pins an item to a channel. )
11
11
  g.command 'add' do |c|
12
12
  c.flag 'channel', desc: 'Channel to pin the messsage to. You must also include a timestamp when pinning messages.'
13
- c.flag 'quip_component_id', desc: 'Component ID for the pins component that was inserted into the channel canvas, if any.'
14
13
  c.flag 'timestamp', desc: 'Timestamp of the message to pin. You must also include the channel.'
15
14
  c.action do |_global_options, options, _args|
16
15
  puts JSON.dump(@client.pins_add(options))
data/bin/commands/team.rb CHANGED
@@ -33,7 +33,7 @@ module Slack
33
33
  g.desc 'Gets information about the current team.'
34
34
  g.long_desc %( Gets information about the current team. )
35
35
  g.command 'info' do |c|
36
- c.flag 'domain', desc: 'Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.'
36
+ c.flag 'domain', desc: "Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself. This is the value set up for the 'Joining This Workspace' workspace setting. If it contains more than one domain, the field will contain multiple comma-separated domain values. If no domain is set, the field is empty."
37
37
  c.flag 'team', desc: 'Team to get info about; if omitted, will return information about the current team.'
38
38
  c.action do |_global_options, options, _args|
39
39
  puts JSON.dump(@client.team_info(options))
@@ -44,7 +44,7 @@ module Slack
44
44
  g.long_desc %( Gets the integration logs for the current team. )
45
45
  g.command 'integrationLogs' do |c|
46
46
  c.flag 'app_id', desc: 'Filter logs to this Slack app. Defaults to all logs.'
47
- c.flag 'change_type', desc: 'Filter logs with this change type. Defaults to all logs.'
47
+ c.flag 'change_type', desc: 'Filter logs with this change type. Possible values are added, removed, enabled, disabled, and updated. Defaults to all logs.'
48
48
  c.flag 'service_id', desc: 'Filter logs to this service. Defaults to all logs.'
49
49
  c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
50
50
  c.flag 'user', desc: "Filter logs generated by this user's actions. Defaults to all logs."
@@ -6,8 +6,8 @@ module Slack
6
6
  class App
7
7
  desc 'Usergroups methods.'
8
8
  command 'usergroups' do |g|
9
- g.desc 'Create a User Group'
10
- g.long_desc %( Create a User Group )
9
+ g.desc 'Create a User Group.'
10
+ g.long_desc %( Create a User Group. )
11
11
  g.command 'create' do |c|
12
12
  c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
13
13
  c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
@@ -20,8 +20,8 @@ module Slack
20
20
  end
21
21
  end
22
22
 
23
- g.desc 'Disable an existing User Group'
24
- g.long_desc %( Disable an existing User Group )
23
+ g.desc 'Disable an existing User Group.'
24
+ g.long_desc %( Disable an existing User Group. )
25
25
  g.command 'disable' do |c|
26
26
  c.flag 'usergroup', desc: 'The encoded ID of the User Group to disable.'
27
27
  c.flag 'include_count', desc: 'Include the number of users in the User Group.'
@@ -31,8 +31,8 @@ module Slack
31
31
  end
32
32
  end
33
33
 
34
- g.desc 'Enable a User Group'
35
- g.long_desc %( Enable a User Group )
34
+ g.desc 'Enable a User Group.'
35
+ g.long_desc %( Enable a User Group. )
36
36
  g.command 'enable' do |c|
37
37
  c.flag 'usergroup', desc: 'The encoded ID of the User Group to enable.'
38
38
  c.flag 'include_count', desc: 'Include the number of users in the User Group.'
@@ -42,8 +42,8 @@ module Slack
42
42
  end
43
43
  end
44
44
 
45
- g.desc 'List all User Groups for a team'
46
- g.long_desc %( List all User Groups for a team )
45
+ g.desc 'List all User Groups for a team.'
46
+ g.long_desc %( List all User Groups for a team. )
47
47
  g.command 'list' do |c|
48
48
  c.flag 'include_count', desc: 'Include the number of users in each User Group.'
49
49
  c.flag 'include_disabled', desc: 'Include disabled User Groups.'
@@ -54,8 +54,8 @@ module Slack
54
54
  end
55
55
  end
56
56
 
57
- g.desc 'Update an existing User Group'
58
- g.long_desc %( Update an existing User Group )
57
+ g.desc 'Update an existing User Group.'
58
+ g.long_desc %( Update an existing User Group. )
59
59
  g.command 'update' do |c|
60
60
  c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
61
61
  c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
@@ -6,10 +6,10 @@ module Slack
6
6
  class App
7
7
  desc 'UsergroupsUsers methods.'
8
8
  command 'usergroups_users' do |g|
9
- g.desc 'List all users in a User Group'
10
- g.long_desc %( List all users in a User Group )
9
+ g.desc 'List all users in a User Group.'
10
+ g.long_desc %( List all users in a User Group. )
11
11
  g.command 'list' do |c|
12
- c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
12
+ c.flag 'usergroup', desc: 'The encoded ID of the User Group to list users for.'
13
13
  c.flag 'include_disabled', desc: 'Allow results that involve disabled User Groups.'
14
14
  c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
15
15
  c.action do |_global_options, options, _args|
@@ -17,12 +17,12 @@ module Slack
17
17
  end
18
18
  end
19
19
 
20
- g.desc 'Update the list of users for a User Group'
21
- g.long_desc %( Update the list of users for a User Group )
20
+ g.desc 'Update the list of users for a user group.'
21
+ g.long_desc %( Update the list of users for a user group. )
22
22
  g.command 'update' do |c|
23
- c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
24
- c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the User Group.'
25
- c.flag 'include_count', desc: 'Include the number of users in the User Group.'
23
+ c.flag 'usergroup', desc: 'The encoded ID of the user group to update.'
24
+ c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the user group.'
25
+ c.flag 'include_count', desc: 'Include the number of users in the user group.'
26
26
  c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
27
27
  c.action do |_global_options, options, _args|
28
28
  puts JSON.dump(@client.usergroups_users_update(options))
@@ -38,8 +38,10 @@ module Slack
38
38
  # Request body.
39
39
  def body
40
40
  @body ||= begin
41
- body = http_request.body.read
42
- http_request.body.rewind
41
+ input = http_request.body
42
+ input.rewind
43
+ body = input.read
44
+ input.rewind
43
45
  body
44
46
  end
45
47
  end
data/lib/slack/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Slack
3
- VERSION = '2.2.0'
3
+ VERSION = '2.3.0'
4
4
  end
@@ -12,9 +12,9 @@ module Slack
12
12
  # @option options [Object] :app_id
13
13
  # The ID of the app to get activities from.
14
14
  # @option options [string] :component_id
15
- # The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows.
15
+ # The component ID of log events to be returned. Will be FnXXXXXX for functions, and WfXXXXXX for worflows.
16
16
  # @option options [string] :component_type
17
- # The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables').
17
+ # The component type of log events to be returned. Acceptable values are events_api, workflows, functions and tables.
18
18
  # @option options [string] :cursor
19
19
  # 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.
20
20
  # @option options [integer] :limit
@@ -26,11 +26,11 @@ module Slack
26
26
  # @option options [integer] :min_date_created
27
27
  # The earliest timestamp of the log to retrieve (epoch microseconds).
28
28
  # @option options [string] :min_log_level
29
- # 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').
30
- # @option options [string] :sort_direction
29
+ # 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.
30
+ # @option options [enum] :sort_direction
31
31
  # The direction you want the data sorted by (always by timestamp).
32
32
  # @option options [string] :source
33
- # The source of log events to be returned. Acceptable values are ('slack', 'developer').
33
+ # The source of log events to be returned. Acceptable values are slack and developer.
34
34
  # @option options [string] :team_id
35
35
  # The team who owns this log.
36
36
  # @option options [string] :trace_id
@@ -24,9 +24,9 @@ module Slack
24
24
  # @option options [Object] :app_id
25
25
  # The encoded app ID to set the app config for.
26
26
  # @option options [object] :domain_restrictions
27
- # Domain restrictions for the app.
28
- # @option options [string] :workflow_auth_strategy
29
- # The workflow auth permission.
27
+ # 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.
28
+ # @option options [enum] :workflow_auth_strategy
29
+ # The workflow auth permission. Can be one of builder_choice or end_user_only.
30
30
  # @see https://api.slack.com/methods/admin.apps.config.set
31
31
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.config/admin.apps.config.set.json
32
32
  def admin_apps_config_set(options = {})
@@ -22,7 +22,7 @@ module Slack
22
22
  # Archive public or private channels in bulk.
23
23
  #
24
24
  # @option options [array] :channel_ids
25
- # An array of channel IDs to archive.
25
+ # An array of channel IDs to archive. No more than 100 items are allowed.
26
26
  # @see https://api.slack.com/methods/admin.conversations.bulkArchive
27
27
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.bulkArchive.json
28
28
  def admin_conversations_bulkArchive(options = {})
@@ -264,6 +264,8 @@ module Slack
264
264
  # 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).
265
265
  # @option options [array] :team_ids
266
266
  # Comma separated string of team IDs, signifying the internal workspaces to search through.
267
+ # @option options [boolean] :total_count_only
268
+ # Only return the total_count of channels. Omits channel data and allows access for admins without channel manager permissions.
267
269
  # @see https://api.slack.com/methods/admin.conversations.search
268
270
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.search.json
269
271
  def admin_conversations_search(options = {})
@@ -23,7 +23,7 @@ module Slack
23
23
  #
24
24
  # @option options [string] :function_id
25
25
  # The function ID to set permissions for.
26
- # @option options [string] :visibility
26
+ # @option options [enum] :visibility
27
27
  # The function visibility.
28
28
  # @option options [array] :user_ids
29
29
  # List of user IDs to allow for named_entities visibility.
@@ -64,6 +64,10 @@ module Slack
64
64
  #
65
65
  # @option options [string] :cursor
66
66
  # Set cursor to next_cursor returned by the previous call to list items in the next page.
67
+ # @option options [boolean] :include_deactivated_user_workspaces
68
+ # Only applies with org token and no team_id. If true, return workspaces for a user even if they may be deactivated on them. If false, return workspaces for a user only when user is active on them. Default is false.
69
+ # @option options [boolean] :is_active
70
+ # If true, only active users will be returned. If false, only deactivated users will be returned. Default is true.
67
71
  # @option options [integer] :limit
68
72
  # Limit for how many users to be retrieved per page.
69
73
  # @option options [Object] :team_id
@@ -23,11 +23,11 @@ module Slack
23
23
  # Number of trigger IDs to fetch for each workflow; default is 0.
24
24
  # @option options [string] :query
25
25
  # A search query to filter for workflow name or description.
26
- # @option options [string] :sort
26
+ # @option options [enum] :sort
27
27
  # The field used to sort the returned workflows.
28
- # @option options [string] :sort_dir
28
+ # @option options [enum] :sort_dir
29
29
  # 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).
30
- # @option options [string] :source
30
+ # @option options [enum] :source
31
31
  # Source of workflow creation, either from code or workflow builder.
32
32
  # @see https://api.slack.com/methods/admin.workflows.search
33
33
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows/admin.workflows.search.json
@@ -27,7 +27,7 @@ module Slack
27
27
  # The earliest timestamp of the log to retrieve (epoch microseconds).
28
28
  # @option options [string] :min_log_level
29
29
  # 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').
30
- # @option options [string] :sort_direction
30
+ # @option options [enum] :sort_direction
31
31
  # The direction you want the data sorted by (always by timestamp).
32
32
  # @option options [string] :source
33
33
  # The source of log events to be returned. Acceptable values are ('slack', 'developer').