slack-ruby-client 2.2.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/integration_test.yml +1 -1
- data/.github/workflows/lint.yml +1 -1
- data/.github/workflows/pr_lint.yml +1 -1
- data/.github/workflows/test.yml +23 -13
- data/.github/workflows/update_api.yml +8 -3
- data/.gitignore +1 -0
- data/CHANGELOG.md +14 -0
- data/README.md +27 -2
- data/bin/commands/admin_apps_activities.rb +4 -4
- data/bin/commands/admin_apps_config.rb +2 -2
- data/bin/commands/admin_conversations.rb +2 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_users.rb +6 -4
- data/bin/commands/admin_workflows.rb +4 -2
- data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
- data/bin/commands/apps_datastore.rb +46 -0
- data/bin/commands/canvases.rb +40 -0
- data/bin/commands/canvases_access.rb +34 -0
- data/bin/commands/canvases_sections.rb +21 -0
- data/bin/commands/chat.rb +9 -9
- data/bin/commands/conversations.rb +3 -2
- data/bin/commands/conversations_canvases.rb +21 -0
- data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
- data/bin/commands/functions.rb +31 -0
- data/bin/commands/functions_distributions_permissions.rb +59 -0
- data/bin/commands/oauth.rb +2 -2
- data/bin/commands/oauth_v2.rb +2 -2
- data/bin/commands/pins.rb +0 -1
- data/bin/commands/reminders.rb +1 -1
- data/bin/commands/team.rb +2 -2
- data/bin/commands/team_externalTeams.rb +35 -0
- data/bin/commands/usergroups.rb +10 -10
- data/bin/commands/usergroups_users.rb +8 -8
- data/bin/commands/users_discoverableContacts.rb +20 -0
- data/bin/commands/workflows_triggers_permissions.rb +60 -0
- data/lib/slack/events/request.rb +4 -2
- data/lib/slack/messages/formatting.rb +13 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_conversations.rb +3 -1
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +6 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +9 -5
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/apps_activities.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_datastore.rb +71 -0
- data/lib/slack/web/api/endpoints/canvases.rb +52 -0
- data/lib/slack/web/api/endpoints/canvases_access.rb +47 -0
- data/lib/slack/web/api/endpoints/canvases_sections.rb +27 -0
- data/lib/slack/web/api/endpoints/chat.rb +21 -21
- data/lib/slack/web/api/endpoints/conversations.rb +4 -2
- data/lib/slack/web/api/endpoints/conversations_canvases.rb +26 -0
- data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
- data/lib/slack/web/api/endpoints/dnd.rb +1 -0
- data/lib/slack/web/api/endpoints/functions.rb +43 -0
- data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +80 -0
- data/lib/slack/web/api/endpoints/oauth.rb +2 -2
- data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
- data/lib/slack/web/api/endpoints/openid_connect.rb +1 -1
- data/lib/slack/web/api/endpoints/pins.rb +0 -2
- data/lib/slack/web/api/endpoints/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/team.rb +3 -3
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +6 -6
- data/lib/slack/web/api/endpoints/users.rb +1 -1
- data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +24 -0
- data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +87 -0
- data/lib/slack/web/api/endpoints.rb +22 -0
- data/lib/slack/web/api/errors.rb +84 -4
- data/lib/slack/web/api/patches/.gitkeep +0 -0
- data/lib/slack/web/api/templates/method.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +2 -1
- data/spec/slack/events/request_spec.rb +11 -0
- data/spec/slack/messages/formatting_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_workflows_triggers_types_permissions_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +29 -0
- data/spec/slack/web/api/endpoints/canvases_access_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/canvases_sections_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/canvases_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/chat_spec.rb +76 -4
- data/spec/slack/web/api/endpoints/conversations_canvases_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +19 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +2 -9
- data/spec/slack/web/api/endpoints/dnd_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/functions_distributions_permissions_spec.rb +10 -0
- data/spec/slack/web/api/endpoints/functions_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/team_externalTeams_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/users_discoverableContacts_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/workflows_triggers_permissions_spec.rb +31 -0
- metadata +37 -3
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b846ffe66e3daaec235dd458c3e695cdf109b5834d5b699f4c548366bebdb1a5
|
4
|
+
data.tar.gz: c70470051b9a5fa2ed6bb58a284e86e30c123429b6f9a183b929c5a303c128d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89b2d6c310698ab94521bd9b1acf4b25362199fcc0e4effc4f860468668eb1cb365c8f3bfdc1ab1a4fb660715eac6c13935272217756ef36e412e245d8b272b6
|
7
|
+
data.tar.gz: e7afd74cd61d65c6bd36d51a1f2cbe50ac9903862daaa999743e27648f3e1f910458b7b6d0d4183fbfb6d93e60b6f2e6484480aae58c64507ec722594255c1e9
|
data/.github/workflows/lint.yml
CHANGED
data/.github/workflows/test.yml
CHANGED
@@ -11,33 +11,43 @@ jobs:
|
|
11
11
|
- { ruby: "3.0" }
|
12
12
|
- { ruby: "3.1" }
|
13
13
|
- { ruby: "3.2" }
|
14
|
+
- { ruby: "3.3" }
|
14
15
|
- { ruby: ruby-head, ignore: true }
|
15
16
|
- { ruby: jruby-head, ignore: true }
|
16
|
-
name: test (ruby=${{ matrix.entry.ruby }}
|
17
|
+
name: test (ruby=${{ matrix.entry.ruby }}${{ matrix.entry.concurrency && ', concurrency=' }}${{ matrix.entry.concurrency }})
|
17
18
|
steps:
|
18
19
|
- name: Checkout
|
19
|
-
uses: actions/checkout@
|
20
|
-
- name: Set up Ruby
|
21
|
-
uses: ruby/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: ${{ matrix.entry.ruby }}
|
24
|
-
bundler-cache: true
|
20
|
+
uses: actions/checkout@v4
|
25
21
|
- name: Set Concurrency
|
26
22
|
run: |
|
27
23
|
if [[ ! -z "${{ matrix.entry.concurrency }}" ]]; then
|
28
24
|
echo "Setting concurrency to ${{ matrix.entry.concurrency }}."
|
29
25
|
echo "CONCURRENCY=${{ matrix.entry.concurrency }}" >> $GITHUB_ENV
|
30
26
|
fi
|
27
|
+
- name: Set up Ruby
|
28
|
+
uses: ruby/setup-ruby@v1
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.entry.ruby }}
|
31
|
+
bundler-cache: true # 'bundle install' and cache gems
|
31
32
|
- name: Run Tests
|
32
33
|
continue-on-error: ${{ matrix.entry.ignore || false }}
|
33
34
|
env:
|
34
35
|
RACK_ENV: test
|
35
|
-
run:
|
36
|
-
bundle install
|
37
|
-
bundle exec rake
|
36
|
+
run: bundle exec rake
|
38
37
|
- name: Coveralls
|
39
|
-
uses: coverallsapp/github-action@
|
38
|
+
uses: coverallsapp/github-action@v2
|
40
39
|
with:
|
40
|
+
parallel: true
|
41
41
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
42
|
-
|
43
|
-
|
42
|
+
flag-name: run-${{ matrix.entry.ruby }}${{ matrix.entry.concurrency && '-'}}${{ matrix.entry.concurrency }}
|
43
|
+
|
44
|
+
finish:
|
45
|
+
name: coveralls
|
46
|
+
needs: test
|
47
|
+
runs-on: ubuntu-latest
|
48
|
+
steps:
|
49
|
+
- name: Close Parallel Build
|
50
|
+
uses: coverallsapp/github-action@v2
|
51
|
+
with:
|
52
|
+
parallel-finished: true
|
53
|
+
carryforward: 'run-2.7,run-2.7-async-websocket,run-3.0,run-3.1,run-3.2,run-3.3'
|
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
contents: write
|
12
12
|
pull-requests: write
|
13
13
|
steps:
|
14
|
-
- uses: actions/checkout@
|
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@
|
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@
|
45
|
+
uses: peter-evans/create-pull-request@v6
|
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/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
### 2.4.0 (2024/07/14)
|
2
|
+
|
3
|
+
* [#516](https://github.com/slack-ruby/slack-ruby-client/pull/516): Add support for Ruby 3.3 - [@olleolleolle](https://github.com/olleolleolle).
|
4
|
+
* [#520](https://github.com/slack-ruby/slack-ruby-client/pull/520): Add support for basic markdown formatting - [@nbgoodall](https://github.com/nbgoodall).
|
5
|
+
* [#523](https://github.com/slack-ruby/slack-ruby-client/pull/523): Fix coveralls handling parallel jobs - [@dblock](https://github.com/dblock).
|
6
|
+
* [#522](https://github.com/slack-ruby-client/pulls/522): Update API from [slack-api-ref@8a22e57](https://github.com/slack-ruby/slack-api-ref/commit/8a22e57) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
7
|
+
|
8
|
+
### 2.3.0 (2024/01/31)
|
9
|
+
|
10
|
+
* [#494](https://github.com/slack-ruby/slack-ruby-client/pull/494): Configure Dependabot to update GitHub Actions - [@olleolleolle](https://github.com/olleolleolle).
|
11
|
+
* [#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).
|
12
|
+
* [#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).
|
13
|
+
* [#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).
|
14
|
+
|
1
15
|
### 2.2.0 (2023/09/17)
|
2
16
|
|
3
17
|
* [#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
@@ -58,6 +58,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
58
58
|
- [Channel ID formatting](#channel-id-formatting)
|
59
59
|
- [User ID formatting](#user-id-formatting)
|
60
60
|
- [URL formatting](#url-formatting)
|
61
|
+
- [Markdown formatting](#markdown-formatting)
|
61
62
|
- [Parsing Messages](#parsing-messages)
|
62
63
|
- [Unescaping message content](#unescaping-message-content)
|
63
64
|
- [Escaping message content](#escaping-message-content)
|
@@ -81,7 +82,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
81
82
|
|
82
83
|
## Stable Release
|
83
84
|
|
84
|
-
You're reading the documentation for the **
|
85
|
+
You're reading the documentation for the **stabke** release of slack-ruby-client, 2.4.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
85
86
|
|
86
87
|
## Installation
|
87
88
|
|
@@ -177,7 +178,7 @@ Upload a file with [files_upload](https://api.slack.com/methods/files.upload).
|
|
177
178
|
client.files_upload(
|
178
179
|
channels: '#general',
|
179
180
|
as_user: true,
|
180
|
-
file: Faraday::
|
181
|
+
file: Faraday::Multipart::FilePart.new('/path/to/avatar.jpg', 'image/jpeg'),
|
181
182
|
title: 'My Avatar',
|
182
183
|
filename: 'avatar.jpg',
|
183
184
|
initial_comment: 'Attached a selfie.'
|
@@ -657,6 +658,30 @@ Slack::Messages::Formatting.url_link(text, url)
|
|
657
658
|
# => "<https://media.giphy.com/media/AcfTF7tyikWyroP0x7/giphy.gif|party time>"
|
658
659
|
```
|
659
660
|
|
661
|
+
##### Markdown formatting
|
662
|
+
|
663
|
+
Slack uses a mishmash of regular markdown formatting with its own syntax. Some features like headings aren't supported and will be left as-is, but others like bold, strikethrough, and links are converted.
|
664
|
+
|
665
|
+
```ruby
|
666
|
+
text = """
|
667
|
+
## A heading
|
668
|
+
**Bold text**
|
669
|
+
~~Strikethrough text~~
|
670
|
+
_Italic text_
|
671
|
+
[A link](https://example.com)
|
672
|
+
`code`
|
673
|
+
"""
|
674
|
+
Slack::Messages::Formatting.markdown(text)
|
675
|
+
# => """
|
676
|
+
# ## A heading
|
677
|
+
# *Bold text*
|
678
|
+
# ~Strikethrough text~
|
679
|
+
# _Italic text_
|
680
|
+
# <https://example.com|A link>
|
681
|
+
# `code`
|
682
|
+
# """
|
683
|
+
```
|
684
|
+
|
660
685
|
#### Parsing Messages
|
661
686
|
|
662
687
|
`Slack::Messages::Formatting` also provides ways to escape or unescape messages. This comes handy, for example, you want to treat all input to a real time bot as plain text.
|
@@ -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:
|
14
|
-
c.flag 'component_type', desc:
|
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:
|
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:
|
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
|
data/bin/commands/admin_emoji.rb
CHANGED
@@ -9,7 +9,7 @@ module Slack
|
|
9
9
|
g.desc 'Add an emoji.'
|
10
10
|
g.long_desc %( Add an emoji. )
|
11
11
|
g.command 'add' do |c|
|
12
|
-
c.flag 'name', desc: 'The name of the emoji to be added. Colons (:myemoji:) around the value are not required, although they may be included.'
|
12
|
+
c.flag 'name', desc: 'The name of the emoji to be added (using lower-case letters only). Colons (:myemoji:) around the value are not required, although they may be included.'
|
13
13
|
c.flag 'url', desc: 'The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.'
|
14
14
|
c.action do |_global_options, options, _args|
|
15
15
|
puts JSON.dump(@client.admin_emoji_add(options))
|
data/bin/commands/admin_users.rb
CHANGED
@@ -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|
|
@@ -58,8 +60,8 @@ module Slack
|
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
61
|
-
g.desc 'Set an existing
|
62
|
-
g.long_desc %( Set an existing
|
63
|
+
g.desc 'Set an existing regular user or owner to be a workspace admin.'
|
64
|
+
g.long_desc %( Set an existing regular user or owner to be a workspace admin. )
|
63
65
|
g.command 'setAdmin' do |c|
|
64
66
|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
65
67
|
c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
|
@@ -79,8 +81,8 @@ module Slack
|
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
82
|
-
g.desc 'Set an existing
|
83
|
-
g.long_desc %( Set an existing
|
84
|
+
g.desc 'Set an existing regular user or admin to be a workspace owner.'
|
85
|
+
g.long_desc %( Set an existing regular user or admin to be a workspace owner. )
|
84
86
|
g.command 'setOwner' do |c|
|
85
87
|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
86
88
|
c.flag 'user_id', desc: 'Id of the user to promote to owner.'
|
@@ -10,15 +10,17 @@ module Slack
|
|
10
10
|
g.long_desc %( Search workflows within the team or enterprise )
|
11
11
|
g.command 'search' do |c|
|
12
12
|
c.flag 'app_id', desc: 'The parent app ID for which to return workflows.'
|
13
|
-
c.flag 'collaborator_ids', desc: 'Only include workflows
|
13
|
+
c.flag 'collaborator_ids', desc: 'Only include workflows where the provided user IDs are a manager/collaborator of that workflow.'
|
14
14
|
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
15
|
+
c.flag 'is_sales_elevate', desc: 'Filter workflows by their Sales Elevate status.'
|
15
16
|
c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation.'
|
16
17
|
c.flag 'no_collaborators', desc: 'Only include workflows with no collaborators in the result; default is false.'
|
17
|
-
c.flag 'num_trigger_ids', desc: 'Number of trigger IDs to fetch for each workflow; default is
|
18
|
+
c.flag 'num_trigger_ids', desc: 'Number of trigger IDs to fetch for each workflow; default is 10.'
|
18
19
|
c.flag 'query', desc: 'A search query to filter for workflow name or description.'
|
19
20
|
c.flag 'sort', desc: 'The field used to sort the returned workflows.'
|
20
21
|
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).'
|
21
22
|
c.flag 'source', desc: 'Source of workflow creation, either from code or workflow builder.'
|
23
|
+
c.flag 'trigger_type_id', desc: 'Only include workflows with this trigger type.'
|
22
24
|
c.action do |_global_options, options, _args|
|
23
25
|
puts JSON.dump(@client.admin_workflows_search(options))
|
24
26
|
end
|
@@ -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 'AdminWorkflowsTriggersTypesPermissions methods.'
|
8
|
+
command 'admin_workflows_triggers_types_permissions' do |g|
|
9
|
+
g.desc 'list the permissions for using each trigger type in workflow builder'
|
10
|
+
g.long_desc %( list the permissions for using each trigger type in workflow builder )
|
11
|
+
g.command 'lookup' do |c|
|
12
|
+
c.flag 'trigger_type_ids', desc: 'The trigger types IDs for which to get the permissions.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump(@client.admin_workflows_triggers_types_permissions_lookup(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
g.desc 'Set the permissions for using a trigger type in workflow builder'
|
19
|
+
g.long_desc %( Set the permissions for using a trigger type in workflow builder )
|
20
|
+
g.command 'set' do |c|
|
21
|
+
c.flag 'id', desc: 'The trigger type ID for which to set the permissions.'
|
22
|
+
c.flag 'visibility', desc: 'The function visibility.'
|
23
|
+
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
|
24
|
+
c.action do |_global_options, options, _args|
|
25
|
+
puts JSON.dump(@client.admin_workflows_triggers_types_permissions_set(options))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -6,6 +6,52 @@ module Slack
|
|
6
6
|
class App
|
7
7
|
desc 'AppsDatastore methods.'
|
8
8
|
command 'apps_datastore' do |g|
|
9
|
+
g.desc 'Delete items from a datastore in bulk'
|
10
|
+
g.long_desc %( Delete items from a datastore in bulk )
|
11
|
+
g.command 'bulkDelete' do |c|
|
12
|
+
c.flag 'datastore', desc: 'name of the datastore.'
|
13
|
+
c.flag 'ids', desc: 'IDs of items to be deleted.'
|
14
|
+
c.flag 'app_id', desc: '.'
|
15
|
+
c.action do |_global_options, options, _args|
|
16
|
+
puts JSON.dump(@client.apps_datastore_bulkDelete(options))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
g.desc 'Get items from a datastore in bulk'
|
21
|
+
g.long_desc %( Get items from a datastore in bulk )
|
22
|
+
g.command 'bulkGet' do |c|
|
23
|
+
c.flag 'datastore', desc: 'name of the datastore.'
|
24
|
+
c.flag 'ids', desc: "items' ids."
|
25
|
+
c.flag 'app_id', desc: '.'
|
26
|
+
c.action do |_global_options, options, _args|
|
27
|
+
puts JSON.dump(@client.apps_datastore_bulkGet(options))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
g.desc 'Creates or replaces existing items in bulk'
|
32
|
+
g.long_desc %( Creates or replaces existing items in bulk )
|
33
|
+
g.command 'bulkPut' do |c|
|
34
|
+
c.flag 'datastore', desc: 'name of the datastore.'
|
35
|
+
c.flag 'items', desc: 'attribute names and values of the items; limit of 25.'
|
36
|
+
c.flag 'app_id', desc: '.'
|
37
|
+
c.action do |_global_options, options, _args|
|
38
|
+
puts JSON.dump(@client.apps_datastore_bulkPut(options))
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
g.desc 'Count the number of items in a datastore that match a query'
|
43
|
+
g.long_desc %( Count the number of items in a datastore that match a query )
|
44
|
+
g.command 'count' do |c|
|
45
|
+
c.flag 'datastore', desc: 'Name of the datastore.'
|
46
|
+
c.flag 'app_id', desc: 'Required if calling with user token.'
|
47
|
+
c.flag 'expression', desc: 'A query filter expression https://api.slack.com/future/datastores.'
|
48
|
+
c.flag 'expression_attributes', desc: 'A map of attributes referenced in expression.'
|
49
|
+
c.flag 'expression_values', desc: 'A map of values referenced in expression.'
|
50
|
+
c.action do |_global_options, options, _args|
|
51
|
+
puts JSON.dump(@client.apps_datastore_count(options))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
9
55
|
g.desc 'Delete an item from a datastore'
|
10
56
|
g.long_desc %( Delete an item from a datastore )
|
11
57
|
g.command 'delete' do |c|
|
@@ -0,0 +1,40 @@
|
|
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 'Canvases methods.'
|
8
|
+
command 'canvases' do |g|
|
9
|
+
g.desc 'Create Canvas for a user.'
|
10
|
+
g.long_desc %( Create Canvas for a user. )
|
11
|
+
g.command 'create' do |c|
|
12
|
+
c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.'
|
13
|
+
c.flag 'title', desc: 'Title of the newly created canvas.'
|
14
|
+
c.action do |_global_options, options, _args|
|
15
|
+
puts JSON.dump(@client.canvases_create(options))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
g.desc 'Deletes a canvas.'
|
20
|
+
g.long_desc %( Deletes a canvas. )
|
21
|
+
g.command 'delete' do |c|
|
22
|
+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
|
23
|
+
c.action do |_global_options, options, _args|
|
24
|
+
puts JSON.dump(@client.canvases_delete(options))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
g.desc 'Update an existing canvas'
|
29
|
+
g.long_desc %( Update an existing canvas )
|
30
|
+
g.command 'edit' do |c|
|
31
|
+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
|
32
|
+
c.flag 'changes', desc: 'List of changes to apply on the specified canvas.'
|
33
|
+
c.action do |_global_options, options, _args|
|
34
|
+
puts JSON.dump(@client.canvases_edit(options))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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 'CanvasesAccess methods.'
|
8
|
+
command 'canvases_access' do |g|
|
9
|
+
g.desc 'Remove access to a canvas for specified entities'
|
10
|
+
g.long_desc %( Remove access to a canvas for specified entities )
|
11
|
+
g.command 'delete' do |c|
|
12
|
+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
|
13
|
+
c.flag 'channel_ids', desc: 'List of channels you wish to update access for.'
|
14
|
+
c.flag 'user_ids', desc: 'List of users you wish to update access for.'
|
15
|
+
c.action do |_global_options, options, _args|
|
16
|
+
puts JSON.dump(@client.canvases_access_delete(options))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
g.desc 'Sets the access level to a canvas for specified entities'
|
21
|
+
g.long_desc %( Sets the access level to a canvas for specified entities )
|
22
|
+
g.command 'set' do |c|
|
23
|
+
c.flag 'access_level', desc: 'Desired level of access (e.g. read, write).'
|
24
|
+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
|
25
|
+
c.flag 'channel_ids', desc: 'List of channels you wish to update access for.'
|
26
|
+
c.flag 'user_ids', desc: 'List of users you wish to update access for.'
|
27
|
+
c.action do |_global_options, options, _args|
|
28
|
+
puts JSON.dump(@client.canvases_access_set(options))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,21 @@
|
|
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 'CanvasesSections methods.'
|
8
|
+
command 'canvases_sections' do |g|
|
9
|
+
g.desc 'Find sections matching the provided criteria'
|
10
|
+
g.long_desc %( Find sections matching the provided criteria )
|
11
|
+
g.command 'lookup' do |c|
|
12
|
+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
|
13
|
+
c.flag 'criteria', desc: 'Filtering criteria.'
|
14
|
+
c.action do |_global_options, options, _args|
|
15
|
+
puts JSON.dump(@client.canvases_sections_lookup(options))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
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: '
|
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
|
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
|
@@ -77,7 +77,7 @@ module Slack
|
|
77
77
|
c.flag 'include_all_metadata', desc: 'Return all metadata associated with this message.'
|
78
78
|
c.flag 'inclusive', desc: 'Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.'
|
79
79
|
c.flag 'latest', desc: 'Only messages before this Unix timestamp will be included in results. Default is the current time.'
|
80
|
-
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
|
80
|
+
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 conversation history hasn't been reached. Maximum of 999."
|
81
81
|
c.flag 'oldest', desc: 'Only messages after this Unix timestamp will be included in results.'
|
82
82
|
c.action do |_global_options, options, _args|
|
83
83
|
puts JSON.dump(@client.conversations_history(options))
|
@@ -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
|
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|
|