slack-ruby-client 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +22 -12
  3. data/.github/workflows/update_api.yml +1 -1
  4. data/.gitignore +1 -0
  5. data/.rubocop_todo.yml +43 -13
  6. data/CHANGELOG.md +19 -0
  7. data/CONTRIBUTING.md +7 -7
  8. data/Gemfile +1 -0
  9. data/README.md +68 -25
  10. data/bin/commands/admin_conversations.rb +21 -0
  11. data/bin/commands/admin_emoji.rb +1 -1
  12. data/bin/commands/admin_users.rb +4 -4
  13. data/bin/commands/admin_users_session.rb +1 -1
  14. data/bin/commands/admin_workflows.rb +6 -2
  15. data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
  16. data/bin/commands/apps_datastore.rb +46 -0
  17. data/bin/commands/assistant_threads.rb +45 -0
  18. data/bin/commands/bookmarks.rb +1 -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 +7 -3
  23. data/bin/commands/conversations.rb +6 -6
  24. data/bin/commands/conversations_canvases.rb +21 -0
  25. data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
  26. data/bin/commands/conversations_requestSharedInvite.rb +48 -0
  27. data/bin/commands/files.rb +2 -1
  28. data/bin/commands/functions_distributions_permissions.rb +59 -0
  29. data/bin/commands/oauth.rb +2 -2
  30. data/bin/commands/oauth_v2.rb +2 -2
  31. data/bin/commands/reminders.rb +1 -1
  32. data/bin/commands/team_externalTeams.rb +35 -0
  33. data/bin/commands/usergroups.rb +5 -0
  34. data/bin/commands/usergroups_users.rb +2 -0
  35. data/bin/commands/users_discoverableContacts.rb +20 -0
  36. data/bin/commands/workflows_triggers_permissions.rb +60 -0
  37. data/examples/files_upload_v2/.env.example +1 -0
  38. data/examples/files_upload_v2/Gemfile +5 -0
  39. data/examples/files_upload_v2/README.md +13 -0
  40. data/examples/files_upload_v2/files_upload_v2.rb +37 -0
  41. data/examples/oauth_v2/.env.example +4 -0
  42. data/examples/oauth_v2/Gemfile +7 -0
  43. data/examples/oauth_v2/README.md +33 -0
  44. data/examples/oauth_v2/oauth_v2.rb +60 -0
  45. data/lib/slack/messages/formatting.rb +13 -0
  46. data/lib/slack/version.rb +1 -1
  47. data/lib/slack/web/api/endpoints/admin_conversations.rb +35 -0
  48. data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
  49. data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
  50. data/lib/slack/web/api/endpoints/admin_users_session.rb +2 -3
  51. data/lib/slack/web/api/endpoints/admin_workflows.rb +10 -2
  52. data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
  53. data/lib/slack/web/api/endpoints/apps_datastore.rb +71 -0
  54. data/lib/slack/web/api/endpoints/assistant_threads.rb +68 -0
  55. data/lib/slack/web/api/endpoints/bookmarks.rb +2 -0
  56. data/lib/slack/web/api/endpoints/canvases.rb +52 -0
  57. data/lib/slack/web/api/endpoints/canvases_access.rb +47 -0
  58. data/lib/slack/web/api/endpoints/canvases_sections.rb +27 -0
  59. data/lib/slack/web/api/endpoints/chat.rb +12 -3
  60. data/lib/slack/web/api/endpoints/conversations.rb +5 -5
  61. data/lib/slack/web/api/endpoints/conversations_canvases.rb +26 -0
  62. data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
  63. data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +73 -0
  64. data/lib/slack/web/api/endpoints/dnd.rb +1 -0
  65. data/lib/slack/web/api/endpoints/files.rb +3 -1
  66. data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +80 -0
  67. data/lib/slack/web/api/endpoints/oauth.rb +2 -2
  68. data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
  69. data/lib/slack/web/api/endpoints/reminders.rb +1 -1
  70. data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
  71. data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
  72. data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
  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 +24 -0
  76. data/lib/slack/web/api/errors.rb +118 -8
  77. data/lib/slack/web/api/helpers/files.rb +87 -0
  78. data/lib/slack/web/api/helpers.rb +13 -0
  79. data/lib/slack/web/api/templates/method.erb +1 -0
  80. data/lib/slack/web/api/templates/method_spec.erb +6 -4
  81. data/lib/slack/web/client.rb +1 -0
  82. data/lib/slack/web/faraday/connection.rb +13 -26
  83. data/lib/slack/web/faraday/options.rb +24 -0
  84. data/lib/slack/web/faraday/request.rb +2 -1
  85. data/lib/slack-ruby-client.rb +2 -0
  86. data/slack-ruby-client.gemspec +2 -1
  87. metadata +52 -144
  88. data/screenshots/create-app.png +0 -0
  89. data/spec/fixtures/slack/web/429_error.yml +0 -81
  90. data/spec/fixtures/slack/web/auth_test_error.yml +0 -81
  91. data/spec/fixtures/slack/web/auth_test_success.yml +0 -81
  92. data/spec/fixtures/slack/web/conversations_info.yml +0 -167
  93. data/spec/fixtures/slack/web/conversations_setTopic.yml +0 -84
  94. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +0 -172
  95. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +0 -253
  96. data/spec/fixtures/slack/web/paginated_users_list.yml +0 -613
  97. data/spec/fixtures/slack/web/rtm_connect.yml +0 -391
  98. data/spec/fixtures/slack/web/users_info.yml +0 -214
  99. data/spec/fixtures/slack/web/users_list.yml +0 -133
  100. data/spec/fixtures/slack/web/views_open_error.yml +0 -83
  101. data/spec/integration/integration_spec.rb +0 -207
  102. data/spec/slack/config_spec.rb +0 -16
  103. data/spec/slack/events/config_spec.rb +0 -35
  104. data/spec/slack/events/request_spec.rb +0 -199
  105. data/spec/slack/messages/formatting_spec.rb +0 -124
  106. data/spec/slack/real_time/api/message_spec.rb +0 -20
  107. data/spec/slack/real_time/api/ping_spec.rb +0 -17
  108. data/spec/slack/real_time/api/typing_spec.rb +0 -19
  109. data/spec/slack/real_time/client_spec.rb +0 -601
  110. data/spec/slack/real_time/concurrency/clients/async_spec.rb +0 -16
  111. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +0 -21
  112. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +0 -10
  113. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +0 -10
  114. data/spec/slack/real_time/event_handlers/bot_spec.rb +0 -47
  115. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +0 -16
  116. data/spec/slack/real_time/event_handlers/im_spec.rb +0 -51
  117. data/spec/slack/real_time/event_handlers/private_channel_spec.rb +0 -99
  118. data/spec/slack/real_time/event_handlers/public_channel_spec.rb +0 -123
  119. data/spec/slack/real_time/event_handlers/team_spec.rb +0 -63
  120. data/spec/slack/real_time/event_handlers/user_spec.rb +0 -65
  121. data/spec/slack/real_time/rtm_connect_spec.rb +0 -14
  122. data/spec/slack/real_time/stores/store_spec.rb +0 -50
  123. data/spec/slack/slack_spec.rb +0 -93
  124. data/spec/slack/version_spec.rb +0 -8
  125. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +0 -13
  126. data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +0 -8
  127. data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +0 -8
  128. data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +0 -18
  129. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +0 -13
  130. data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +0 -8
  131. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +0 -18
  132. data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +0 -8
  133. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +0 -35
  134. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +0 -38
  135. data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +0 -8
  136. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +0 -32
  137. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +0 -133
  138. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +0 -37
  139. data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +0 -21
  140. data/spec/slack/web/api/endpoints/admin_functions_spec.rb +0 -13
  141. data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +0 -8
  142. data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +0 -8
  143. data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +0 -18
  144. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +0 -30
  145. data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +0 -13
  146. data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +0 -13
  147. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +0 -53
  148. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +0 -16
  149. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +0 -37
  150. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +0 -41
  151. data/spec/slack/web/api/endpoints/admin_users_spec.rb +0 -67
  152. data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +0 -8
  153. data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +0 -24
  154. data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +0 -13
  155. data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +0 -13
  156. data/spec/slack/web/api/endpoints/api_spec.rb +0 -8
  157. data/spec/slack/web/api/endpoints/apps_activities_spec.rb +0 -13
  158. data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +0 -13
  159. data/spec/slack/web/api/endpoints/apps_connections_spec.rb +0 -8
  160. data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +0 -45
  161. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +0 -13
  162. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +0 -44
  163. data/spec/slack/web/api/endpoints/apps_spec.rb +0 -16
  164. data/spec/slack/web/api/endpoints/auth_spec.rb +0 -8
  165. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +0 -8
  166. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +0 -40
  167. data/spec/slack/web/api/endpoints/bots_spec.rb +0 -8
  168. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +0 -24
  169. data/spec/slack/web/api/endpoints/calls_spec.rb +0 -31
  170. data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +0 -8
  171. data/spec/slack/web/api/endpoints/chat_spec.rb +0 -134
  172. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -8
  173. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +0 -27
  174. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +0 -206
  175. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +0 -13
  176. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +0 -40
  177. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +0 -38
  178. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +0 -112
  179. data/spec/slack/web/api/endpoints/dialog_spec.rb +0 -14
  180. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -13
  181. data/spec/slack/web/api/endpoints/emoji_spec.rb +0 -8
  182. data/spec/slack/web/api/endpoints/files_comments_spec.rb +0 -16
  183. data/spec/slack/web/api/endpoints/files_remote_spec.rb +0 -24
  184. data/spec/slack/web/api/endpoints/files_spec.rb +0 -57
  185. data/spec/slack/web/api/endpoints/functions_spec.rb +0 -28
  186. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +0 -13
  187. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +0 -13
  188. data/spec/slack/web/api/endpoints/migration_spec.rb +0 -13
  189. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -8
  190. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +0 -16
  191. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +0 -8
  192. data/spec/slack/web/api/endpoints/pins_spec.rb +0 -23
  193. data/spec/slack/web/api/endpoints/reactions_spec.rb +0 -24
  194. data/spec/slack/web/api/endpoints/reminders_spec.rb +0 -31
  195. data/spec/slack/web/api/endpoints/rtm_spec.rb +0 -8
  196. data/spec/slack/web/api/endpoints/search_spec.rb +0 -23
  197. data/spec/slack/web/api/endpoints/stars_spec.rb +0 -8
  198. data/spec/slack/web/api/endpoints/team_billing_spec.rb +0 -8
  199. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +0 -8
  200. data/spec/slack/web/api/endpoints/team_profile_spec.rb +0 -8
  201. data/spec/slack/web/api/endpoints/team_spec.rb +0 -8
  202. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +0 -13
  203. data/spec/slack/web/api/endpoints/usergroups_spec.rb +0 -28
  204. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +0 -21
  205. data/spec/slack/web/api/endpoints/users_admin_spec.rb +0 -18
  206. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +0 -8
  207. data/spec/slack/web/api/endpoints/users_profile_spec.rb +0 -14
  208. data/spec/slack/web/api/endpoints/users_spec.rb +0 -8
  209. data/spec/slack/web/api/endpoints/views_spec.rb +0 -65
  210. data/spec/slack/web/api/endpoints/workflows_spec.rb +0 -34
  211. data/spec/slack/web/api/error_spec.rb +0 -14
  212. data/spec/slack/web/api/errors/slack_error_spec.rb +0 -33
  213. data/spec/slack/web/api/mixins/conversations_list_spec.rb +0 -21
  214. data/spec/slack/web/api/mixins/conversations_spec.rb +0 -45
  215. data/spec/slack/web/api/mixins/users_spec.rb +0 -52
  216. data/spec/slack/web/api/options_spec.rb +0 -69
  217. data/spec/slack/web/api/pagination/cursor_spec.rb +0 -102
  218. data/spec/slack/web/client_spec.rb +0 -359
  219. data/spec/slack/web/faraday/request_spec.rb +0 -80
  220. data/spec/slack/web/faraday/response/raise_error_spec.rb +0 -86
  221. data/spec/spec_helper.rb +0 -30
  222. data/spec/support/queue_with_timeout.rb +0 -35
  223. data/spec/support/real_time/concurrency/mock.rb +0 -31
  224. data/spec/support/real_time/connected_client.rb +0 -21
  225. data/spec/support/real_time/event.rb +0 -12
  226. data/spec/support/real_time/loaded_client.rb +0 -120
  227. data/spec/support/token.rb +0 -11
  228. data/spec/support/vcr.rb +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7dd6a8acd792da60c4f03242bea5e978f0aefa04cef7cd1884eeb0e61c2ea15a
4
- data.tar.gz: a55940551456236d78faa93b93cad4704de07117f3e295c08a0dcf31582a176a
3
+ metadata.gz: f433d0a8172888831bf4115f08a954719a90723fb5b2c3ae232a343b43e8fff3
4
+ data.tar.gz: d5689f3951b2b70f6e80143d57ec538c88b6df46445e6f85c4e26f357ce7ce59
5
5
  SHA512:
6
- metadata.gz: 3baa04a2834d3a1a0483708b9521cec7b1e6cc914b526bdfa064f3f065fcbb7b728b56b87c0dc43087f7e2f6e54e19949b0d1f3e6efa95f31c4bdfc285e22b97
7
- data.tar.gz: 8eef87ae2c4eed1e877136a518614de11f2f7ff86019f329ddc3165726a1ef06bde0da4648915fb5c15dc2ebd1ea4aa43f358cc75667d77612782edc8f88ce50
6
+ metadata.gz: 21c7eb94417fa3071e6e95dcc588ca4affad4c4faa22bc878e175b1851e10090bbd304fbe6b27a7ff20650bd14b95ca4e92ed00de7ad5abf8f2e97a5d6375e57
7
+ data.tar.gz: 95e0922c4d5ef759d4a4cbea728aa27486ccb9a52167b28c24d2aeb2b178a11b121697d0a431e5ac9f6c800101f3f99a3a3b160a4f7d6b326d7db1f5cf2011bc
@@ -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
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@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'
@@ -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@v5
45
+ uses: peter-evans/create-pull-request@v7
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
@@ -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/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2023-08-05 13:32:37 UTC using RuboCop version 1.26.1.
3
+ # on 2025-02-08 15:52:13 UTC using RuboCop version 1.26.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -44,30 +44,42 @@ Lint/RedundantCopDisableDirective:
44
44
  Exclude:
45
45
  - 'lib/slack-ruby-client.rb'
46
46
 
47
- # Offense count: 12
47
+ # Offense count: 13
48
48
  # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
49
49
  Metrics/AbcSize:
50
- Max: 36
50
+ Max: 58
51
51
 
52
- # Offense count: 4
52
+ # Offense count: 6
53
53
  # Configuration parameters: IgnoredMethods.
54
54
  Metrics/CyclomaticComplexity:
55
- Max: 10
55
+ Max: 11
56
56
 
57
- # Offense count: 13
57
+ # Offense count: 15
58
58
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
59
59
  Metrics/MethodLength:
60
- Max: 26
60
+ Max: 35
61
61
 
62
62
  # Offense count: 1
63
63
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
64
64
  Metrics/ParameterLists:
65
65
  Max: 6
66
66
 
67
- # Offense count: 2
67
+ # Offense count: 3
68
68
  # Configuration parameters: IgnoredMethods.
69
69
  Metrics/PerceivedComplexity:
70
- Max: 10
70
+ Max: 12
71
+
72
+ # Offense count: 1
73
+ # Configuration parameters: MinSize.
74
+ Performance/CollectionLiteralInLoop:
75
+ Exclude:
76
+ - 'spec/slack/web/api/endpoints/custom_specs/files_spec.rb'
77
+
78
+ # Offense count: 1
79
+ # This cop supports safe auto-correction (--auto-correct).
80
+ Performance/MapCompact:
81
+ Exclude:
82
+ - 'lib/slack/web/api/helpers/files.rb'
71
83
 
72
84
  # Offense count: 2
73
85
  # This cop supports safe auto-correction (--auto-correct).
@@ -81,20 +93,20 @@ Performance/StringInclude:
81
93
  Exclude:
82
94
  - 'lib/tasks/web.rake'
83
95
 
84
- # Offense count: 8
96
+ # Offense count: 9
85
97
  # This cop supports safe auto-correction (--auto-correct).
86
98
  RSpec/ContextMethod:
87
99
  Exclude:
88
100
  - 'spec/slack/messages/formatting_spec.rb'
89
101
  - 'spec/slack/web/api/mixins/users_spec.rb'
90
102
 
91
- # Offense count: 82
103
+ # Offense count: 83
92
104
  # Configuration parameters: Prefixes.
93
105
  # Prefixes: when, with, without
94
106
  RSpec/ContextWording:
95
107
  Enabled: false
96
108
 
97
- # Offense count: 65
109
+ # Offense count: 70
98
110
  # Configuration parameters: CountAsOne.
99
111
  RSpec/ExampleLength:
100
112
  Max: 18
@@ -111,7 +123,7 @@ RSpec/FilePath:
111
123
  RSpec/MessageSpies:
112
124
  EnforcedStyle: receive
113
125
 
114
- # Offense count: 94
126
+ # Offense count: 95
115
127
  RSpec/MultipleExpectations:
116
128
  Max: 5
117
129
 
@@ -166,6 +178,13 @@ Rake/Desc:
166
178
  Exclude:
167
179
  - 'lib/tasks/git.rake'
168
180
 
181
+ # Offense count: 1
182
+ # Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
183
+ # SupportedStyles: inline, group
184
+ Style/AccessModifierDeclarations:
185
+ Exclude:
186
+ - 'lib/slack/real_time/client.rb'
187
+
169
188
  # Offense count: 4
170
189
  # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
171
190
  # SupportedStyles: annotated, template, unannotated
@@ -181,6 +200,17 @@ Style/GlobalStdStream:
181
200
  - 'spec/integration/integration_spec.rb'
182
201
  - 'spec/slack/web/client_spec.rb'
183
202
 
203
+ # Offense count: 1
204
+ # This cop supports unsafe auto-correction (--auto-correct-all).
205
+ Style/MapToHash:
206
+ Exclude:
207
+ - 'spec/slack/web/api/endpoints/custom_specs/files_spec.rb'
208
+
209
+ # Offense count: 1
210
+ Style/MultilineBlockChain:
211
+ Exclude:
212
+ - 'lib/slack/web/api/helpers/files.rb'
213
+
184
214
  # Offense count: 1
185
215
  # This cop supports safe auto-correction (--auto-correct).
186
216
  Style/MultilineTernaryOperator:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ### 2.5.0 (2025/02/09)
2
+
3
+ * [#525](https://github.com/slack-ruby/slack-ruby-client/pull/525): Exclude spec files from gem package - [@amatsuda](https://github.com/amatsuda).
4
+ * [#527](https://github.com/slack-ruby/slack-ruby-client/pull/527): Explicitly require `racc` and `ostruct` - [@dblock](https://github.com/dblock).
5
+ * [#528](https://github.com/slack-ruby/slack-ruby-client/pull/528): Don't treat asterisks in list items as italic in markdown - [@rspeicher](https://github.com/rspeicher).
6
+ * [#530](https://github.com/slack-ruby/slack-ruby-client/pull/530): Specify dependency on `logger` - [@rwstauner](https://github.com/rwstauner).
7
+ * [#533](https://github.com/slack-ruby/slack-ruby-client/pull/533), [#536](https://github.com/slack-ruby/slack-ruby-client/pull/536): Added `files_upload_v2` - [@gregsaab](https://github.com/gregsaab).
8
+ * [#538](https://github.com/slack-ruby/slack-ruby-client/pull/538): Translate channel names and support an array of channels in `files_upload_v2` - [@dblock](https://github.com/dblock).
9
+ * [#540](https://github.com/slack-ruby/slack-ruby-client/pull/540): Added support for `channel` and `channel_id`, do not require channel in `files_upload_v2` - [@dblock](https://github.com/dblock).
10
+ * [#541](https://github.com/slack-ruby/slack-ruby-client/pull/541): Added samples for `oauth_v2` and `files_upload_v2` - [@dblock](https://github.com/dblock).
11
+ * [#524](https://github.com/slack-ruby-client/pulls/524): Update API from [slack-api-ref@3ec3c10](https://github.com/slack-ruby/slack-api-ref/commit/3ec3c10) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
12
+
13
+ ### 2.4.0 (2024/07/14)
14
+
15
+ * [#516](https://github.com/slack-ruby/slack-ruby-client/pull/516): Add support for Ruby 3.3 - [@olleolleolle](https://github.com/olleolleolle).
16
+ * [#520](https://github.com/slack-ruby/slack-ruby-client/pull/520): Add support for basic markdown formatting - [@nbgoodall](https://github.com/nbgoodall).
17
+ * [#523](https://github.com/slack-ruby/slack-ruby-client/pull/523): Fix coveralls handling parallel jobs - [@dblock](https://github.com/dblock).
18
+ * [#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).
19
+
1
20
  ### 2.3.0 (2024/01/31)
2
21
 
3
22
  * [#494](https://github.com/slack-ruby/slack-ruby-client/pull/494): Configure Dependabot to update GitHub Actions - [@olleolleolle](https://github.com/olleolleolle).
data/CONTRIBUTING.md CHANGED
@@ -27,15 +27,15 @@ bundle exec rake
27
27
 
28
28
  ### Run Examples in Development
29
29
 
30
- Sign up for Slack, create a private slack group for yourself.
30
+ Sign up for Slack, create a private Slack team for yourself, then [generate an API token](https://api.slack.com/tutorials/tracks/getting-a-token) for your app and use it for some interactions.
31
31
 
32
- Create a new App under [https://api.slack.com/apps](https://api.slack.com/apps).
32
+ Try running the examples in the [examples](examples) directory.
33
33
 
34
- ![](screenshots/create-app.png)
35
-
36
- On the next screen, note the API token.
37
-
38
- To run [the example in examples/hi_real_time_and_web](examples/hi_real_time_and_web/hi.rb), open a terminal, cd into _examples/hi_real_time_and_web_, run `bundle install`, followed by `SLACK_API_TOKEN=<your API token> bundle exec ruby hi.rb`.
34
+ ```bash
35
+ cd examples/hi_web
36
+ bundle install
37
+ SLACK_API_TOKEN=... bundle exec ruby hi.rb
38
+ ```
39
39
 
40
40
  ## Contribute Code
41
41
 
data/Gemfile CHANGED
@@ -17,6 +17,7 @@ group :test do
17
17
  gem 'erubis'
18
18
  gem 'faraday-typhoeus'
19
19
  gem 'json-schema'
20
+ gem 'racc'
20
21
  gem 'rake', '~> 13'
21
22
  gem 'rspec'
22
23
  gem 'rubocop', '1.26.1' # Lock to specific version to avoid breaking cops/changes
data/README.md CHANGED
@@ -54,13 +54,14 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
54
54
  - [Verifying the Request Signature](#verifying-the-request-signature)
55
55
  - [Message Handling](#message-handling)
56
56
  - [Formatting Messages](#formatting-messages)
57
- - [Date and time formatting](#date-and-time-formatting)
58
- - [Channel ID formatting](#channel-id-formatting)
59
- - [User ID formatting](#user-id-formatting)
60
- - [URL formatting](#url-formatting)
57
+ - [Date and Time Formatting](#date-and-time-formatting)
58
+ - [Channel ID Formatting](#channel-id-formatting)
59
+ - [User ID Formatting](#user-id-formatting)
60
+ - [URL Formatting](#url-formatting)
61
+ - [Markdown Formatting](#markdown-formatting)
61
62
  - [Parsing Messages](#parsing-messages)
62
- - [Unescaping message content](#unescaping-message-content)
63
- - [Escaping message content](#escaping-message-content)
63
+ - [Unescaping Message Content](#unescaping-message-content)
64
+ - [Escaping Message Content](#escaping-message-content)
64
65
  - [Command-Line Client](#command-line-client)
65
66
  - [Authenticate with Slack](#authenticate-with-slack)
66
67
  - [Send a Message](#send-a-message)
@@ -74,14 +75,13 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
74
75
 
75
76
  ## Useful to Me?
76
77
 
77
- * This library will let you send messages to Slack via the Web API, send and receive messages via the Real Time Messaging API and facilitate integration with the Events API.
78
- * To respond to slash commands, interactive components or events, implement a web application using your favorite web framework and use this library to call the Slack Web API and to verify that events are coming from Slack.
79
- * To build a bot using the Real Time Messaging API, use [slack-ruby-bot](https://github.com/slack-ruby/slack-ruby-bot), which uses this library.
80
- * To roll out a complete service using the Real Time Messaging API with Slack button integration to multiple teams, check out [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server), which is built on top of slack-ruby-bot, which uses this library.
78
+ * This library lets you send messages to Slack via the Web API, send and receive messages via the Real Time Messaging API, and facilitates integration with the Events API.
79
+ * To write a complete bot for Slack you need more than this library, and it's much easier to start with [slack-ruby-bot-server-events](https://github.com/slack-ruby/slack-ruby-bot-server-events).
80
+ * To respond to slash commands, interactive components, or events at the lowest level, implement a web application using your favorite web framework, and use this library to call the Slack Web API, and to verify that events are coming from Slack.
81
81
 
82
82
  ## Stable Release
83
83
 
84
- You're reading the documentation for the **stable** release of slack-ruby-client, 2.3.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
84
+ You're reading the documentation for the **stable** release of slack-ruby-client 2.5.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
85
85
 
86
86
  ## Installation
87
87
 
@@ -105,11 +105,9 @@ Run `bundle install`.
105
105
 
106
106
  To integrate your bot with Slack, you must first create a new [Slack App](https://api.slack.com/apps).
107
107
 
108
- ![](screenshots/create-app.png)
109
-
110
108
  ### OAuth Code Grant
111
109
 
112
- Once created, go to the app's Basic Info tab and grab the Client ID and Client Secret. You'll need these in order complete an [OAuth code grant flow](https://api.slack.com/docs/oauth#flow) as described at [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server).
110
+ Once created, go to the app's Basic Info tab and grab the Client ID and Client Secret. You'll need these in order complete an [OAuth Workflow](https://api.slack.com/authentication/oauth-v2). A working sample that starts a local web server and obtains a bot or a user token for your app using OAuth v2 is available in [examples/oauth_v2](examples/oauth_v2).
113
111
 
114
112
  ### Using an API Token
115
113
 
@@ -171,7 +169,28 @@ general_channel = channels.detect { |c| c.name == 'general' }
171
169
 
172
170
  ##### Upload a File
173
171
 
174
- Upload a file with [files_upload](https://api.slack.com/methods/files.upload).
172
+ Upload files with [sequenced API calls](https://api.slack.com/messaging/files#uploading_files).
173
+
174
+ This library provides a helper method `files_upload_v2` that wraps the three separate API calls.
175
+
176
+ ```ruby
177
+ client.files_upload_v2(
178
+ # required options
179
+ filename: 'results.pdf', # this is used for the file title, unless a :title option is provided
180
+ contents: File.read('/users/me/results.pdf'), # the string contents of the file
181
+
182
+ # optional options
183
+ channels: ['C000000', 'C000001'], # channel IDs to share the file in (:channel_id, :channel, or :channels are all supported)
184
+ initial_comment: 'Sharing the Q1 results :tada:', # the message that is included with the file share thread
185
+ snippet_type: 'text', # the type of snippet
186
+ title: 'Q1 Results', # sets the title of the file, overriding the filename
187
+ thread_ts: '1738331487.481469' # specifies a thread to add this file to
188
+ )
189
+ ```
190
+
191
+ You can use a channel ID passed as `channel_id`, a single channel as `channel`, an array of channel IDs as `channels`, or a channel name or names (prefixed with `#`) in `files_upload_v2`. Lookup by name is not supported by the Slack API and this method called invokes `conversations_list` in order to locate the channel ID. This invocation can have a cost if you have many Slack channels and is only recommended when you intend to list channels anyway.
192
+
193
+ Note: This library includes a `files_upload` method that uses a deprecated endpoint `files.upload` that will [no longer be supported on 3/11/2025](https://api.slack.com/methods/files.upload#markdown).
175
194
 
176
195
  ```ruby
177
196
  client.files_upload(
@@ -595,15 +614,15 @@ The `verify!` call may raise `Slack::Events::Request::MissingSigningSecret`, `Sl
595
614
 
596
615
  ### Message Handling
597
616
 
598
- All text in Slack uses the same [system of formatting and escaping](https://api.slack.com/docs/formatting): chat messages, direct messages, file comments, etc. [Slack::Messages::Formatting](lib/slack/messages/formatting.rb) provides convenience methods to format and parse messages.
617
+ All text in Slack uses the same [system of Formatting and escaping](https://api.slack.com/docs/formatting): chat messages, direct messages, file comments, etc. [Slack::Messages::Formatting](lib/slack/messages/formatting.rb) provides convenience methods to format and parse messages.
599
618
 
600
619
  #### Formatting Messages
601
620
 
602
- `Slack::Messages::Formatting` provides a number of methods for formatting objects that you can then embed in outgoing messages.
621
+ `Slack::Messages::Formatting` provides a number of methods for Formatting objects that you can then embed in outgoing messages.
603
622
 
604
- ##### Date and time formatting
623
+ ##### Date and Time Formatting
605
624
 
606
- You can embed a pre-formatted date in a message as a string like any other text, but using Slack's date formatting allows you to display dates based on user preferences for dates and times, incorporating users' local time zones, and optionally using relative values like "yesterday", "today", or "tomorrow" when appropriate.
625
+ You can embed a pre-formatted date in a message as a string like any other text, but using Slack's date Formatting allows you to display dates based on user preferences for dates and times, incorporating users' local time zones, and optionally using relative values like "yesterday", "today", or "tomorrow" when appropriate.
607
626
 
608
627
  ```ruby
609
628
  date = Time.now
@@ -626,7 +645,7 @@ Slack::Messages::Formatting.date(date, text: 'party time!')
626
645
  # => "<!date^1688150386^{date_num} {time_secs}|party time!>"
627
646
  ```
628
647
 
629
- ##### Channel ID formatting
648
+ ##### Channel ID Formatting
630
649
 
631
650
  If you already know the channel name you can just embed it in the message as `#some-channel`, but if you only have the ID you can embed it using special syntax which Slack will display as the channel name (while respecting channel visibility).
632
651
 
@@ -636,7 +655,7 @@ Slack::Messages::Formatting.channel_link(channel_id)
636
655
  # => "<#C0000000001>"
637
656
  ```
638
657
 
639
- ##### User ID formatting
658
+ ##### User ID Formatting
640
659
 
641
660
  If you already know the user name you can just embed it in the message as `@some_username`, but if you only have the ID you can embed it using special syntax which Slack will display as the user name.
642
661
 
@@ -646,9 +665,9 @@ Slack::Messages::Formatting.user_link(user_id)
646
665
  # => "<@U0000000001>"
647
666
  ```
648
667
 
649
- ##### URL formatting
668
+ ##### URL Formatting
650
669
 
651
- Slack will automatically parse fully qualified URLs in messages, but you need special formatting to embed a link with different text.
670
+ Slack will automatically parse fully qualified URLs in messages, but you need special Formatting to embed a link with different text.
652
671
 
653
672
  ```ruby
654
673
  text = 'party time'
@@ -657,11 +676,35 @@ Slack::Messages::Formatting.url_link(text, url)
657
676
  # => "<https://media.giphy.com/media/AcfTF7tyikWyroP0x7/giphy.gif|party time>"
658
677
  ```
659
678
 
679
+ ##### Markdown Formatting
680
+
681
+ 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.
682
+
683
+ ```ruby
684
+ text = """
685
+ ## A heading
686
+ **Bold text**
687
+ ~~Strikethrough text~~
688
+ _Italic text_
689
+ [A link](https://example.com)
690
+ `code`
691
+ """
692
+ Slack::Messages::Formatting.markdown(text)
693
+ # => """
694
+ # ## A heading
695
+ # *Bold text*
696
+ # ~Strikethrough text~
697
+ # _Italic text_
698
+ # <https://example.com|A link>
699
+ # `code`
700
+ # """
701
+ ```
702
+
660
703
  #### Parsing Messages
661
704
 
662
705
  `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.
663
706
 
664
- ##### Unescaping message content
707
+ ##### Unescaping Message Content
665
708
 
666
709
  ```ruby
667
710
  Slack::Messages::Formatting.unescape('Hello &amp; &lt;world&gt;')
@@ -686,7 +729,7 @@ Slack::Messages::Formatting.unescape('‘hello’')
686
729
  # => "'hello'"
687
730
  ```
688
731
 
689
- ##### Escaping message content
732
+ ##### Escaping Message Content
690
733
 
691
734
  ```ruby
692
735
  Slack::Messages::Formatting.escape('Hello & <world>')
@@ -133,6 +133,17 @@ module Slack
133
133
  end
134
134
  end
135
135
 
136
+ g.desc 'Link a Salesforce record to a channel'
137
+ g.long_desc %( Link a Salesforce record to a channel )
138
+ g.command 'linkObjects' do |c|
139
+ c.flag 'channel', desc: 'Channel ID for Slack channel that will be linked to a Salesforce record.'
140
+ c.flag 'record_id', desc: 'Salesforce record ID (15 or 18 digit accepted). See here for how to look up record ID.'
141
+ c.flag 'salesforce_org_id', desc: 'Salesforce org ID (15 or 18 digit accepted). See here for how to look up Salesforce org ID.'
142
+ c.action do |_global_options, options, _args|
143
+ puts JSON.dump(@client.admin_conversations_linkObjects(options))
144
+ end
145
+ end
146
+
136
147
  g.desc 'Returns channels on the given team using the filters.'
137
148
  g.long_desc %( Returns channels on the given team using the filters. )
138
149
  g.command 'lookup' do |c|
@@ -222,6 +233,16 @@ module Slack
222
233
  puts JSON.dump(@client.admin_conversations_unarchive(options))
223
234
  end
224
235
  end
236
+
237
+ g.desc 'Unlink a Salesforce record from a channel'
238
+ g.long_desc %( Unlink a Salesforce record from a channel )
239
+ g.command 'unlinkObjects' do |c|
240
+ c.flag 'channel', desc: 'Channel ID for Slack channel that will be unlinked from the Salesforce record.'
241
+ c.flag 'new_name', desc: 'Channel name you would like to give to the channel that is being unlinked from the Salesforce record.'
242
+ c.action do |_global_options, options, _args|
243
+ puts JSON.dump(@client.admin_conversations_unlinkObjects(options))
244
+ end
245
+ end
225
246
  end
226
247
  end
227
248
  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))
@@ -60,8 +60,8 @@ module Slack
60
60
  end
61
61
  end
62
62
 
63
- g.desc 'Set an existing guest, regular user, or owner to be an admin user.'
64
- 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. )
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 guest, regular user, or admin user to be a workspace owner.'
85
- 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. )
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.'
@@ -28,7 +28,7 @@ module Slack
28
28
  g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. )
29
29
  g.command 'invalidate' do |c|
30
30
  c.flag 'session_id', desc: 'ID of the session to invalidate.'
31
- c.flag 'team_id', desc: 'ID of the workspace that the session belongs to.'
31
+ c.flag 'user_id', desc: 'ID of the user that the session belongs to.'
32
32
  c.action do |_global_options, options, _args|
33
33
  puts JSON.dump(@client.admin_users_session_invalidate(options))
34
34
  end
@@ -10,15 +10,19 @@ 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 all of 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.'
19
+ c.flag 'publish_status', desc: 'Filter workflows by their published status.'
18
20
  c.flag 'query', desc: 'A search query to filter for workflow name or description.'
19
21
  c.flag 'sort', desc: 'The field used to sort the returned workflows.'
20
22
  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
23
  c.flag 'source', desc: 'Source of workflow creation, either from code or workflow builder.'
24
+ c.flag 'step_function_ids', desc: 'Only include workflows that use all of the provided step function ids.'
25
+ c.flag 'trigger_type_id', desc: 'Only include workflows with this trigger type.'
22
26
  c.action do |_global_options, options, _args|
23
27
  puts JSON.dump(@client.admin_workflows_search(options))
24
28
  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'
10
+ g.long_desc %( list the permissions for using each trigger type )
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'
19
+ g.long_desc %( Set the permissions for using a trigger type )
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|