slack-ruby-client 2.3.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/workflows/test.yml +22 -12
- data/.github/workflows/update_api.yml +1 -1
- data/.gitignore +1 -0
- data/CHANGELOG.md +7 -0
- data/README.md +26 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_users.rb +4 -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/conversations.rb +1 -1
- data/bin/commands/conversations_canvases.rb +21 -0
- data/bin/commands/conversations_externalInvitePermissions.rb +22 -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/reminders.rb +1 -1
- data/bin/commands/team_externalTeams.rb +35 -0
- data/bin/commands/users_discoverableContacts.rb +20 -0
- data/bin/commands/workflows_triggers_permissions.rb +60 -0
- data/lib/slack/messages/formatting.rb +13 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +6 -2
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
- 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/conversations.rb +1 -1
- 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_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/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
- 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 +20 -0
- data/lib/slack/web/api/errors.rb +70 -4
- data/lib/slack/web/api/templates/method.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +2 -1
- 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/conversations_canvases_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +19 -0
- 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/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 +32 -2
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/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
20
|
uses: actions/checkout@v4
|
20
|
-
- name: Set up Ruby
|
21
|
-
uses: ruby/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: ${{ matrix.entry.ruby }}
|
24
|
-
bundler-cache: true
|
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'
|
@@ -42,7 +42,7 @@ jobs:
|
|
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 }})
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
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
|
+
|
1
8
|
### 2.3.0 (2024/01/31)
|
2
9
|
|
3
10
|
* [#494](https://github.com/slack-ruby/slack-ruby-client/pull/494): Configure Dependabot to update GitHub Actions - [@olleolleolle](https://github.com/olleolleolle).
|
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
|
|
@@ -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.
|
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
@@ -60,8 +60,8 @@ module Slack
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
g.desc 'Set an existing
|
64
|
-
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. )
|
65
65
|
g.command 'setAdmin' do |c|
|
66
66
|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
67
67
|
c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
|
@@ -81,8 +81,8 @@ module Slack
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
g.desc 'Set an existing
|
85
|
-
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. )
|
86
86
|
g.command 'setOwner' do |c|
|
87
87
|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
88
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
|
@@ -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))
|
@@ -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 'ConversationsCanvases methods.'
|
8
|
+
command 'conversations_canvases' do |g|
|
9
|
+
g.desc 'Create a Channel Canvas for a channel.'
|
10
|
+
g.long_desc %( Create a Channel Canvas for a channel. )
|
11
|
+
g.command 'create' do |c|
|
12
|
+
c.flag 'channel_id', desc: 'Channel ID of the channel we create the channel canvas for.'
|
13
|
+
c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.'
|
14
|
+
c.action do |_global_options, options, _args|
|
15
|
+
puts JSON.dump(@client.conversations_canvases_create(options))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
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 'ConversationsExternalinvitepermissions methods.'
|
8
|
+
command 'conversations_externalInvitePermissions' do |g|
|
9
|
+
g.desc "Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'."
|
10
|
+
g.long_desc %( Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'. )
|
11
|
+
g.command 'set' do |c|
|
12
|
+
c.flag 'action', desc: 'Type of action to be taken: upgrade or downgrade.'
|
13
|
+
c.flag 'channel', desc: 'The channel ID to change external invite permissions for.'
|
14
|
+
c.flag 'target_team', desc: 'The encoded team ID of the target team. Must be in the specified channel.'
|
15
|
+
c.action do |_global_options, options, _args|
|
16
|
+
puts JSON.dump(@client.conversations_externalInvitePermissions_set(options))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,59 @@
|
|
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 'FunctionsDistributionsPermissions methods.'
|
8
|
+
command 'functions_distributions_permissions' do |g|
|
9
|
+
g.desc 'Grant users access to a custom slack function if its permission_type is set to named_entities'
|
10
|
+
g.long_desc %( Grant users access to a custom slack function if its permission_type is set to named_entities )
|
11
|
+
g.command 'add' do |c|
|
12
|
+
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
|
13
|
+
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
|
14
|
+
c.flag 'function_id', desc: 'The encoded ID of the function.'
|
15
|
+
c.flag 'user_ids', desc: 'List of encoded user IDs.'
|
16
|
+
c.action do |_global_options, options, _args|
|
17
|
+
puts JSON.dump(@client.functions_distributions_permissions_add(options))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
g.desc 'List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities'
|
22
|
+
g.long_desc %( List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities )
|
23
|
+
g.command 'list' do |c|
|
24
|
+
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
|
25
|
+
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
|
26
|
+
c.flag 'function_id', desc: 'The encoded ID of the function.'
|
27
|
+
c.action do |_global_options, options, _args|
|
28
|
+
puts JSON.dump(@client.functions_distributions_permissions_list(options))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
g.desc 'Revoke user access to a custom slack function if permission_type set to named_entities'
|
33
|
+
g.long_desc %( Revoke user access to a custom slack function if permission_type set to named_entities )
|
34
|
+
g.command 'remove' do |c|
|
35
|
+
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
|
36
|
+
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
|
37
|
+
c.flag 'function_id', desc: 'The encoded ID of the function.'
|
38
|
+
c.flag 'user_ids', desc: 'List of encoded user IDs.'
|
39
|
+
c.action do |_global_options, options, _args|
|
40
|
+
puts JSON.dump(@client.functions_distributions_permissions_remove(options))
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
g.desc 'Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities'
|
45
|
+
g.long_desc %( Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities )
|
46
|
+
g.command 'set' do |c|
|
47
|
+
c.flag 'permission_type', desc: 'The type of permission that defines how the function can be distributed.'
|
48
|
+
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
|
49
|
+
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
|
50
|
+
c.flag 'function_id', desc: 'The encoded ID of the function.'
|
51
|
+
c.flag 'user_ids', desc: 'List of encoded user IDs.'
|
52
|
+
c.action do |_global_options, options, _args|
|
53
|
+
puts JSON.dump(@client.functions_distributions_permissions_set(options))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/bin/commands/oauth.rb
CHANGED
@@ -9,8 +9,8 @@ module Slack
|
|
9
9
|
g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
|
10
10
|
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
|
11
11
|
g.command 'access' do |c|
|
12
|
-
c.flag 'client_id', desc: 'Issued when you created your application.'
|
13
|
-
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
12
|
+
c.flag 'client_id', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
|
13
|
+
c.flag 'client_secret', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
|
14
14
|
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
15
15
|
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
16
16
|
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel. Only valid with a legacy workspace app.'
|
data/bin/commands/oauth_v2.rb
CHANGED
@@ -9,8 +9,8 @@ module Slack
|
|
9
9
|
g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
|
10
10
|
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
|
11
11
|
g.command 'access' do |c|
|
12
|
-
c.flag 'client_id', desc: 'Issued when you created your application.'
|
13
|
-
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
12
|
+
c.flag 'client_id', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
|
13
|
+
c.flag 'client_secret', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
|
14
14
|
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
15
15
|
c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
|
16
16
|
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
data/bin/commands/reminders.rb
CHANGED
@@ -10,7 +10,7 @@ module Slack
|
|
10
10
|
g.long_desc %( Creates a reminder. )
|
11
11
|
g.command 'add' do |c|
|
12
12
|
c.flag 'text', desc: 'The content of the reminder.'
|
13
|
-
c.flag 'time', desc: 'When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").'
|
13
|
+
c.flag 'time', desc: 'Can also take a type of integer. When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").'
|
14
14
|
c.flag 'recurrence', desc: 'Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.'
|
15
15
|
c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
|
16
16
|
c.flag 'user', desc: 'No longer supported - reminders cannot be set for other users. Previously, was the user who would receive the reminder.'
|
@@ -0,0 +1,35 @@
|
|
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 'TeamExternalteams methods.'
|
8
|
+
command 'team_externalTeams' do |g|
|
9
|
+
g.desc 'Disconnect an external organization.'
|
10
|
+
g.long_desc %( Disconnect an external organization. )
|
11
|
+
g.command 'disconnect' do |c|
|
12
|
+
c.flag 'target_team', desc: 'The team ID of the target team.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump(@client.team_externalTeams_disconnect(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
g.desc 'Returns a list of all the external teams connected and details about the connection.'
|
19
|
+
g.long_desc %( Returns a list of all the external teams connected and details about the connection. )
|
20
|
+
g.command 'list' do |c|
|
21
|
+
c.flag 'connection_status_filter', desc: 'Status of the connected team.'
|
22
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting parameter to the team_id attribute returned by a previous request's response_metadata. If not provided, the first page of the collection is returned. See pagination for more detail."
|
23
|
+
c.flag 'limit', desc: 'The maximum number of items to return per page.'
|
24
|
+
c.flag 'slack_connect_pref_filter', desc: 'Filters connected orgs by Slack Connect pref override(s). Value can be: approved_orgs_only allow_sc_file_uploads profile_visibility away_team_sc_invite_permissions accept_sc_invites sc_mpdm_to_private require_sc_channel_for_sc_dm external_awareness_context_bar.'
|
25
|
+
c.flag 'sort_direction', desc: 'Direction to sort in asc or desc.'
|
26
|
+
c.flag 'sort_field', desc: 'Name of the parameter that we are sorting by.'
|
27
|
+
c.flag 'workspace_filter', desc: 'Shows connected orgs which are connected on a specified encoded workspace ID.'
|
28
|
+
c.action do |_global_options, options, _args|
|
29
|
+
puts JSON.dump(@client.team_externalTeams_list(options))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
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 'UsersDiscoverablecontacts methods.'
|
8
|
+
command 'users_discoverableContacts' do |g|
|
9
|
+
g.desc 'Look up an email address to see if someone is discoverable on Slack'
|
10
|
+
g.long_desc %( Look up an email address to see if someone is discoverable on Slack )
|
11
|
+
g.command 'lookup' do |c|
|
12
|
+
c.flag 'email', desc: '.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump(@client.users_discoverableContacts_lookup(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|