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.
Files changed (98) 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 +23 -13
  7. data/.github/workflows/update_api.yml +8 -3
  8. data/.gitignore +1 -0
  9. data/CHANGELOG.md +14 -0
  10. data/README.md +27 -2
  11. data/bin/commands/admin_apps_activities.rb +4 -4
  12. data/bin/commands/admin_apps_config.rb +2 -2
  13. data/bin/commands/admin_conversations.rb +2 -1
  14. data/bin/commands/admin_emoji.rb +1 -1
  15. data/bin/commands/admin_users.rb +6 -4
  16. data/bin/commands/admin_workflows.rb +4 -2
  17. data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
  18. data/bin/commands/apps_datastore.rb +46 -0
  19. data/bin/commands/canvases.rb +40 -0
  20. data/bin/commands/canvases_access.rb +34 -0
  21. data/bin/commands/canvases_sections.rb +21 -0
  22. data/bin/commands/chat.rb +9 -9
  23. data/bin/commands/conversations.rb +3 -2
  24. data/bin/commands/conversations_canvases.rb +21 -0
  25. data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
  26. data/bin/commands/functions.rb +31 -0
  27. data/bin/commands/functions_distributions_permissions.rb +59 -0
  28. data/bin/commands/oauth.rb +2 -2
  29. data/bin/commands/oauth_v2.rb +2 -2
  30. data/bin/commands/pins.rb +0 -1
  31. data/bin/commands/reminders.rb +1 -1
  32. data/bin/commands/team.rb +2 -2
  33. data/bin/commands/team_externalTeams.rb +35 -0
  34. data/bin/commands/usergroups.rb +10 -10
  35. data/bin/commands/usergroups_users.rb +8 -8
  36. data/bin/commands/users_discoverableContacts.rb +20 -0
  37. data/bin/commands/workflows_triggers_permissions.rb +60 -0
  38. data/lib/slack/events/request.rb +4 -2
  39. data/lib/slack/messages/formatting.rb +13 -0
  40. data/lib/slack/version.rb +1 -1
  41. data/lib/slack/web/api/endpoints/admin_apps_activities.rb +5 -5
  42. data/lib/slack/web/api/endpoints/admin_apps_config.rb +3 -3
  43. data/lib/slack/web/api/endpoints/admin_conversations.rb +3 -1
  44. data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
  45. data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +1 -1
  46. data/lib/slack/web/api/endpoints/admin_users.rb +6 -2
  47. data/lib/slack/web/api/endpoints/admin_workflows.rb +9 -5
  48. data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
  49. data/lib/slack/web/api/endpoints/apps_activities.rb +1 -1
  50. data/lib/slack/web/api/endpoints/apps_datastore.rb +71 -0
  51. data/lib/slack/web/api/endpoints/canvases.rb +52 -0
  52. data/lib/slack/web/api/endpoints/canvases_access.rb +47 -0
  53. data/lib/slack/web/api/endpoints/canvases_sections.rb +27 -0
  54. data/lib/slack/web/api/endpoints/chat.rb +21 -21
  55. data/lib/slack/web/api/endpoints/conversations.rb +4 -2
  56. data/lib/slack/web/api/endpoints/conversations_canvases.rb +26 -0
  57. data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
  58. data/lib/slack/web/api/endpoints/dnd.rb +1 -0
  59. data/lib/slack/web/api/endpoints/functions.rb +43 -0
  60. data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +80 -0
  61. data/lib/slack/web/api/endpoints/oauth.rb +2 -2
  62. data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
  63. data/lib/slack/web/api/endpoints/openid_connect.rb +1 -1
  64. data/lib/slack/web/api/endpoints/pins.rb +0 -2
  65. data/lib/slack/web/api/endpoints/reminders.rb +1 -1
  66. data/lib/slack/web/api/endpoints/search.rb +3 -3
  67. data/lib/slack/web/api/endpoints/team.rb +3 -3
  68. data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
  69. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  70. data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
  71. data/lib/slack/web/api/endpoints/usergroups_users.rb +6 -6
  72. data/lib/slack/web/api/endpoints/users.rb +1 -1
  73. data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +24 -0
  74. data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +87 -0
  75. data/lib/slack/web/api/endpoints.rb +22 -0
  76. data/lib/slack/web/api/errors.rb +84 -4
  77. data/lib/slack/web/api/patches/.gitkeep +0 -0
  78. data/lib/slack/web/api/templates/method.erb +1 -0
  79. data/lib/slack/web/api/templates/method_spec.erb +2 -1
  80. data/spec/slack/events/request_spec.rb +11 -0
  81. data/spec/slack/messages/formatting_spec.rb +32 -0
  82. data/spec/slack/web/api/endpoints/admin_workflows_triggers_types_permissions_spec.rb +21 -0
  83. data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +29 -0
  84. data/spec/slack/web/api/endpoints/canvases_access_spec.rb +21 -0
  85. data/spec/slack/web/api/endpoints/canvases_sections_spec.rb +16 -0
  86. data/spec/slack/web/api/endpoints/canvases_spec.rb +21 -0
  87. data/spec/slack/web/api/endpoints/chat_spec.rb +76 -4
  88. data/spec/slack/web/api/endpoints/conversations_canvases_spec.rb +13 -0
  89. data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +19 -0
  90. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +2 -9
  91. data/spec/slack/web/api/endpoints/dnd_spec.rb +5 -0
  92. data/spec/slack/web/api/endpoints/functions_distributions_permissions_spec.rb +10 -0
  93. data/spec/slack/web/api/endpoints/functions_spec.rb +28 -0
  94. data/spec/slack/web/api/endpoints/team_externalTeams_spec.rb +13 -0
  95. data/spec/slack/web/api/endpoints/users_discoverableContacts_spec.rb +13 -0
  96. data/spec/slack/web/api/endpoints/workflows_triggers_permissions_spec.rb +31 -0
  97. metadata +37 -3
  98. 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: b846ffe66e3daaec235dd458c3e695cdf109b5834d5b699f4c548366bebdb1a5
4
+ data.tar.gz: c70470051b9a5fa2ed6bb58a284e86e30c123429b6f9a183b929c5a303c128d1
5
5
  SHA512:
6
- metadata.gz: 8d41b9da28c2e14c25567e4ab620779095cc0c0f12b633937e4e4f2aa7c69b482f13cb1b9ad0353576cd2f2bd1d8c710680115b70f2fae2ef68488b334ee759e
7
- data.tar.gz: 1ac12afca5aa38457b9fc72da39662e0b301fa2fd4ffc7d5aefddca62dc7c5988193104356e4a5b16a8c6b9ec0b28adce52f7ceda2486982c85e7eba07fbfcac
6
+ metadata.gz: 89b2d6c310698ab94521bd9b1acf4b25362199fcc0e4effc4f860468668eb1cb365c8f3bfdc1ab1a4fb660715eac6c13935272217756ef36e412e245d8b272b6
7
+ data.tar.gz: e7afd74cd61d65c6bd36d51a1f2cbe50ac9903862daaa999743e27648f3e1f910458b7b6d0d4183fbfb6d93e60b6f2e6484480aae58c64507ec722594255c1e9
@@ -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
@@ -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 }}, concurrency=${{ matrix.entry.concurrency || 'none' }})
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@v3
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@master
38
+ uses: coverallsapp/github-action@v2
40
39
  with:
40
+ parallel: true
41
41
  github-token: ${{ secrets.GITHUB_TOKEN }}
42
- - name: Coveralls Finished
43
- uses: coverallsapp/github-action@master
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@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@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
@@ -5,5 +5,6 @@
5
5
  .idea
6
6
  .rspec_status
7
7
  Gemfile.lock
8
+ Gemfile.danger.lock
8
9
  pkg
9
10
  coverage
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 **stable** release of slack-ruby-client, 2.2.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
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::UploadIO.new('/path/to/avatar.jpg', 'image/jpeg'),
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: "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
@@ -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))
@@ -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 guest, regular user, or owner to be an admin user.'
62
- g.long_desc %( Set an existing guest, regular user, or owner to be an admin user. )
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 guest, regular user, or admin user to be a workspace owner.'
83
- g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. )
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 by the collaborators inputted.'
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 0.'
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: '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
@@ -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 users list hasn't been reached."
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 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|