slack-ruby-client 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +3 -0
  4. data/.rubocop_todo.yml +30 -34
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +9 -0
  7. data/CONTRIBUTING.md +2 -2
  8. data/Gemfile +3 -1
  9. data/README.md +1 -1
  10. data/Rakefile +1 -1
  11. data/bin/commands/channels.rb +18 -9
  12. data/bin/commands/chat.rb +24 -3
  13. data/bin/commands/dialog.rb +14 -0
  14. data/bin/commands/files.rb +21 -0
  15. data/bin/commands/groups.rb +10 -10
  16. data/bin/commands/migration.rb +14 -0
  17. data/bin/commands/rtm.rb +2 -4
  18. data/bin/commands/users.rb +18 -18
  19. data/bin/commands/users_admin.rb +28 -0
  20. data/bin/commands/users_prefs.rb +12 -0
  21. data/bin/commands.rb +5 -1
  22. data/bin/slack +1 -1
  23. data/examples/hi_real_time/hi.rb +1 -1
  24. data/examples/hi_real_time_and_web/hi.rb +1 -1
  25. data/examples/hi_real_time_async_celluloid/hi.rb +1 -1
  26. data/examples/hi_real_time_async_eventmachine/hi.rb +1 -1
  27. data/examples/hi_web/hi.rb +1 -1
  28. data/examples/new_ticket/new_ticket.rb +1 -1
  29. data/lib/slack/messages/formatting.rb +4 -4
  30. data/lib/slack/messages/message.rb +1 -2
  31. data/lib/slack/real_time/api/templates/event_handler.erb +1 -1
  32. data/lib/slack/real_time/client.rb +10 -9
  33. data/lib/slack/real_time/concurrency/celluloid.rb +5 -1
  34. data/lib/slack/real_time/config.rb +11 -11
  35. data/lib/slack/real_time/models/base.rb +1 -2
  36. data/lib/slack/real_time/socket.rb +2 -2
  37. data/lib/slack/real_time/stores/base.rb +1 -2
  38. data/lib/slack/real_time/stores/starter.rb +76 -76
  39. data/lib/slack/real_time/stores/store.rb +104 -94
  40. data/lib/slack/version.rb +1 -1
  41. data/lib/slack/web/api/endpoints/api.rb +1 -1
  42. data/lib/slack/web/api/endpoints/apps_permissions.rb +2 -2
  43. data/lib/slack/web/api/endpoints/auth.rb +2 -2
  44. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  45. data/lib/slack/web/api/endpoints/channels.rb +27 -15
  46. data/lib/slack/web/api/endpoints/chat.rb +42 -9
  47. data/lib/slack/web/api/endpoints/conversations.rb +17 -17
  48. data/lib/slack/web/api/endpoints/dialog.rb +32 -0
  49. data/lib/slack/web/api/endpoints/dnd.rb +5 -5
  50. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  51. data/lib/slack/web/api/endpoints/files.rb +37 -6
  52. data/lib/slack/web/api/endpoints/files_comments.rb +3 -3
  53. data/lib/slack/web/api/endpoints/groups.rb +17 -17
  54. data/lib/slack/web/api/endpoints/im.rb +6 -6
  55. data/lib/slack/web/api/endpoints/migration.rb +25 -0
  56. data/lib/slack/web/api/endpoints/mpim.rb +6 -6
  57. data/lib/slack/web/api/endpoints/oauth.rb +2 -2
  58. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  59. data/lib/slack/web/api/endpoints/presence.rb +1 -1
  60. data/lib/slack/web/api/endpoints/reactions.rb +4 -4
  61. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  62. data/lib/slack/web/api/endpoints/rtm.rb +3 -7
  63. data/lib/slack/web/api/endpoints/search.rb +3 -3
  64. data/lib/slack/web/api/endpoints/stars.rb +3 -3
  65. data/lib/slack/web/api/endpoints/team.rb +4 -4
  66. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  67. data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
  68. data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
  69. data/lib/slack/web/api/endpoints/users.rb +8 -8
  70. data/lib/slack/web/api/endpoints/users_admin.rb +46 -0
  71. data/lib/slack/web/api/endpoints/users_prefs.rb +19 -0
  72. data/lib/slack/web/api/endpoints/users_profile.rb +2 -2
  73. data/lib/slack/web/api/endpoints.rb +10 -2
  74. data/lib/slack/web/api/mixins/ids.id.rb +1 -1
  75. data/lib/slack/web/api/mixins/users.search.rb +38 -36
  76. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
  77. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +1 -1
  78. data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
  79. data/lib/slack/web/api/templates/command.erb +2 -1
  80. data/lib/slack/web/api/templates/commands.erb +1 -1
  81. data/lib/slack/web/api/templates/endpoints.erb +2 -2
  82. data/lib/slack/web/api/templates/method.erb +8 -3
  83. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  84. data/lib/slack/web/config.rb +12 -12
  85. data/lib/slack/web/faraday/response/raise_error.rb +3 -3
  86. data/lib/tasks/git.rake +1 -1
  87. data/lib/tasks/real_time.rake +1 -1
  88. data/lib/tasks/web.rake +4 -1
  89. data/slack-ruby-client.gemspec +2 -3
  90. data/spec/slack/messages/formatting_spec.rb +1 -1
  91. data/spec/slack/real_time/client_spec.rb +3 -2
  92. data/spec/slack/real_time/concurrency/celluloid_spec.rb +1 -1
  93. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +1 -1
  94. data/spec/slack/real_time/event_handlers/bot_spec.rb +4 -2
  95. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
  96. data/spec/slack/real_time/event_handlers/user_spec.rb +4 -2
  97. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +28 -0
  98. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +8 -6
  99. data/spec/slack/web/api/endpoints/files_spec.rb +16 -0
  100. data/spec/slack/web/api/endpoints/migration_spec.rb +12 -0
  101. data/spec/slack/web/api/endpoints/users_admin_spec.rb +17 -0
  102. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +7 -0
  103. data/spec/slack/web/api/error_spec.rb +1 -1
  104. data/spec/slack/web/api/errors/slack_error_spec.rb +1 -1
  105. data/spec/slack/web/api/mixins/users_spec.rb +6 -4
  106. data/spec/support/queue_with_timeout.rb +1 -1
  107. data/spec/support/real_time/concurrency/mock.rb +1 -2
  108. metadata +34 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b96448be8f1c835685f93f3393f8920cae201f40
4
- data.tar.gz: 425cd9b3c64c3ece99de2ee2fd678b088cee8332
3
+ metadata.gz: b4523b02fb8e41e2a529f21283e9631aca6e04bb
4
+ data.tar.gz: 6324f7a54941b201b7aa729178418241accf836c
5
5
  SHA512:
6
- metadata.gz: 1ef45ffaa491253809ea56bbcdff87ca957ac483da23a3233b8167452e7cdf36f071fa94fd1cb123f1dd6eb148d6b590c64fee78d1df0301689d6ca8964d9bc1
7
- data.tar.gz: 38041c875f7b29eb12b0345bae2b04664dab1d31d1eda39c408feabff8f3f180112c28be13b4909737474f6c06c70ccb48c3faf1ad2b6acd9384ec4dd6bf97b4
6
+ metadata.gz: 958f43b8c6c3591d81761e60c310c6cf2638b26ab79b9bf56748768a2e8800fdad85733262c5a93d4272b3861f475b2cbb2f1eabb01fadb3a2848a09c82be3d7
7
+ data.tar.gz: 1787862cbf85c3cd762c8b044afd89d98c92ee0cd959aaf94da5b5d513cd3c24c3d8de005eece992a5f13ed76a8279231d40d8ade39dd32c4efe692c9118b79c
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ pkg
3
3
  Gemfile.lock
4
4
  .DS_Store
5
5
  .bundle
6
+ .idea
data/.rubocop.yml CHANGED
@@ -3,4 +3,7 @@ AllCops:
3
3
  - vendor/**/*
4
4
  - lib/slack/web/api/slack-api-ref/**/*
5
5
 
6
+ Naming/MethodName:
7
+ Enabled: false
8
+
6
9
  inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-09-19 15:04:24 -0400 using RuboCop version 0.35.0.
3
+ # on 2017-11-25 11:28:32 -0500 using RuboCop version 0.51.0.
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
@@ -14,34 +14,38 @@ Lint/HandleExceptions:
14
14
  - 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
15
15
 
16
16
  # Offense count: 1
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: IgnoreEmptyBlocks.
19
- Lint/UnusedBlockArgument:
17
+ Lint/RescueWithoutErrorClass:
20
18
  Exclude:
21
- - 'lib/slack/messages/formatting.rb'
19
+ - 'lib/slack/real_time/concurrency/celluloid.rb'
22
20
 
23
21
  # Offense count: 18
24
22
  Metrics/AbcSize:
25
23
  Max: 44
26
24
 
25
+ # Offense count: 81
26
+ # Configuration parameters: CountComments, ExcludedMethods.
27
+ Metrics/BlockLength:
28
+ Max: 421
29
+
27
30
  # Offense count: 2
28
31
  # Configuration parameters: CountComments.
29
32
  Metrics/ClassLength:
30
- Max: 165
33
+ Max: 166
31
34
 
32
35
  # Offense count: 4
33
36
  Metrics/CyclomaticComplexity:
34
37
  Max: 9
35
38
 
36
- # Offense count: 734
37
- # Configuration parameters: AllowURI, URISchemes.
39
+ # Offense count: 741
40
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
41
+ # URISchemes: http, https
38
42
  Metrics/LineLength:
39
43
  Max: 266
40
44
 
41
- # Offense count: 9
45
+ # Offense count: 10
42
46
  # Configuration parameters: CountComments.
43
47
  Metrics/MethodLength:
44
- Max: 32
48
+ Max: 42
45
49
 
46
50
  # Offense count: 1
47
51
  # Configuration parameters: CountComments.
@@ -52,28 +56,32 @@ Metrics/ModuleLength:
52
56
  Metrics/PerceivedComplexity:
53
57
  Max: 11
54
58
 
55
- # Offense count: 64
56
- # Configuration parameters: Exclude.
57
- Style/Documentation:
58
- Enabled: false
59
-
60
59
  # Offense count: 1
61
- # Configuration parameters: Exclude.
62
- Style/FileName:
60
+ # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
61
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
62
+ Naming/FileName:
63
63
  Exclude:
64
64
  - 'lib/slack-ruby-client.rb'
65
65
 
66
- # Offense count: 136
66
+ # Offense count: 63
67
+ Style/Documentation:
68
+ Enabled: false
69
+
70
+ # Offense count: 137
67
71
  # Configuration parameters: AllowedVariables.
68
72
  Style/GlobalVars:
69
73
  Enabled: false
70
74
 
71
- # Offense count: 24
72
- # Configuration parameters: EnforcedStyle, SupportedStyles.
73
- Style/MethodName:
74
- Enabled: false
75
+ # Offense count: 2
76
+ # Configuration parameters: MinBodyLength.
77
+ Style/GuardClause:
78
+ Exclude:
79
+ - 'lib/slack/real_time/stores/store.rb'
80
+ - 'lib/slack/web/faraday/response/raise_error.rb'
75
81
 
76
82
  # Offense count: 3
83
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
84
+ # SupportedStyles: module_function, extend_self
77
85
  Style/ModuleFunction:
78
86
  Exclude:
79
87
  - 'lib/slack/config.rb'
@@ -84,15 +92,3 @@ Style/ModuleFunction:
84
92
  Style/MultilineTernaryOperator:
85
93
  Exclude:
86
94
  - 'spec/support/real_time/connected_client.rb'
87
-
88
- # Offense count: 1
89
- # Cop supports --auto-correct.
90
- Style/RescueModifier:
91
- Exclude:
92
- - 'lib/slack/real_time/concurrency/celluloid.rb'
93
-
94
- # Offense count: 2
95
- # Cop supports --auto-correct.
96
- Style/SpecialGlobalVars:
97
- Exclude:
98
- - 'lib/slack/messages/formatting.rb'
data/.travis.yml CHANGED
@@ -5,7 +5,6 @@ cache: bundler
5
5
  rvm:
6
6
  - 2.2
7
7
  - 2.1
8
- - 2.0
9
8
  - 2.3.4
10
9
  - ruby-head
11
10
  - jruby-head
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 0.11.0 (11/25/2017)
2
+
3
+ * [#173](https://github.com/slack-ruby/slack-ruby-client/issues/173): Added dialog support - [@alexagranov](https://github.com/alexagranov).
4
+ * [#176](https://github.com/slack-ruby/slack-ruby-client/issues/176): Drop dependency on `json` gem - [@seuros](https://github.com/seuros).
5
+ * [#177](https://github.com/slack-ruby/slack-ruby-client/pull/177): Fix api ref repo - [@manuelmeurer](https://github.com/manuelmeurer).
6
+ * [#180](https://github.com/slack-ruby/slack-ruby-client/pull/180): Upgraded RuboCop 0.51.0 - [@dblock](https://github.com/dblock).
7
+ * [#181](https://github.com/slack-ruby/slack-ruby-client/pull/181): Added `chat_getPermalink`, `migration_exchange` - [@dblock](https://github.com/dblock).
8
+ * [#182](https://github.com/slack-ruby/slack-ruby-client/pull/182): Added undocumented methods support with `channels_delete`, `chat_command`, `files_edit`, `files_share`, `users_admin_invite`, `users_admin_setInactive` and `users_prefs_get` - [@dblock](https://github.com/dblock).
9
+
1
10
  ### 0.10.0 (9/19/2017)
2
11
 
3
12
  * [#169](https://github.com/slack-ruby/slack-ruby-client/pull/169): Added [Conversations API](https://api.slack.com/docs/conversations-api) - [@jmanian](https://github.com/jmanian).
data/CONTRIBUTING.md CHANGED
@@ -65,7 +65,7 @@ Make sure that `bundle exec rake` completes without errors.
65
65
 
66
66
  ### Update Slack Web API
67
67
 
68
- Slack Web API is updated from https://github.com/dblock/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.
68
+ Slack Web API is updated from https://github.com/slack-ruby/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.
69
69
 
70
70
  ```
71
71
  rake slack:api:update
@@ -78,7 +78,7 @@ Sometimes it's necessary to patch auto-generated Slack Web API methods. For exam
78
78
  Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb` and generate a patch.
79
79
 
80
80
  ```
81
- git diff HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.1.patch
81
+ git diff --no-color HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.1.patch
82
82
  ```
83
83
 
84
84
  Run `rake slack:api:update` to ensure that the patch is cleanly applied. Implement a test for the added or modified functionality and commit the patch file.
data/Gemfile CHANGED
@@ -3,8 +3,10 @@ source 'http://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem ENV['CONCURRENCY'], require: false if ENV.key?('CONCURRENCY')
6
- gem 'picky' unless RUBY_PLATFORM == 'java'
6
+ # rubocop:enable Bundler/OrderedGems
7
+
7
8
  gem 'activesupport', '~> 4.0'
9
+ gem 'picky' unless RUBY_PLATFORM == 'java'
8
10
 
9
11
  group :test do
10
12
  gem 'slack-ruby-danger', '~> 0.1.0', require: false
data/README.md CHANGED
@@ -18,7 +18,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messa
18
18
 
19
19
  ## Stable Release
20
20
 
21
- You're reading the documentation for the **stable** release of slack-ruby-client, 0.10.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
21
+ You're reading the documentation for the **stable** release of slack-ruby-client, 0.11.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
22
22
 
23
23
  ## Installation
24
24
 
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ end
14
14
  require 'rubocop/rake_task'
15
15
  RuboCop::RakeTask.new
16
16
 
17
- task default: [:rubocop, :spec]
17
+ task default: %i[rubocop spec]
18
18
 
19
19
  load 'tasks/git.rake'
20
20
  load 'tasks/web.rake'
@@ -21,6 +21,15 @@ command 'channels' do |g|
21
21
  end
22
22
  end
23
23
 
24
+ g.desc 'Delete a channel (undocumented)'
25
+ g.long_desc %( Delete a channel )
26
+ g.command 'delete' do |c|
27
+ c.flag 'channel', desc: 'Channel to delete.'
28
+ c.action do |_global_options, options, _args|
29
+ puts JSON.dump($client.channels_delete(options))
30
+ end
31
+ end
32
+
24
33
  g.desc 'Fetches history of messages and events from a channel.'
25
34
  g.long_desc %( Fetches history of messages and events from a channel. )
26
35
  g.command 'history' do |c|
@@ -34,6 +43,15 @@ command 'channels' do |g|
34
43
  end
35
44
  end
36
45
 
46
+ g.desc 'This method returns the ID of a team channel.'
47
+ g.long_desc %( This method returns the ID of a team channel. )
48
+ g.command 'id' do |c|
49
+ c.flag 'channel', desc: 'Channel to get ID for, prefixed with #.'
50
+ c.action do |_global_options, options, _args|
51
+ puts JSON.dump($client.channels_id(options))
52
+ end
53
+ end
54
+
37
55
  g.desc 'Gets information about a channel.'
38
56
  g.long_desc %( Gets information about a channel. )
39
57
  g.command 'info' do |c|
@@ -154,13 +172,4 @@ command 'channels' do |g|
154
172
  puts JSON.dump($client.channels_unarchive(options))
155
173
  end
156
174
  end
157
-
158
- g.desc 'This method returns the ID of a team channel.'
159
- g.long_desc %( This method returns the ID of a team channel. )
160
- g.command 'id' do |c|
161
- c.flag 'channel', desc: 'Channel to get ID for, prefixed with #.'
162
- c.action do |_global_options, options, _args|
163
- puts JSON.dump($client.channels_id(options))
164
- end
165
- end
166
175
  end
data/bin/commands/chat.rb CHANGED
@@ -2,17 +2,38 @@
2
2
 
3
3
  desc 'Post chat messages to Slack.'
4
4
  command 'chat' do |g|
5
+ g.desc 'Execute a slash command in a public channel (undocumented)'
6
+ g.long_desc %( Execute a slash command in a public channel )
7
+ g.command 'command' do |c|
8
+ c.flag 'channel', desc: 'Channel to execute the command in.'
9
+ c.flag 'command', desc: 'Slash command to be executed. Leading backslash is required.'
10
+ c.flag 'text', desc: 'Additional parameters provided to the slash command.'
11
+ c.action do |_global_options, options, _args|
12
+ puts JSON.dump($client.chat_command(options))
13
+ end
14
+ end
15
+
5
16
  g.desc 'Deletes a message.'
6
17
  g.long_desc %( Deletes a message. )
7
18
  g.command 'delete' do |c|
8
19
  c.flag 'channel', desc: 'Channel containing the message to be deleted.'
9
20
  c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
10
- c.flag 'as_user', desc: 'Pass true to delete the message as the authed user. Bot users in this context are considered authed users.'
21
+ c.flag 'as_user', desc: 'Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.'
11
22
  c.action do |_global_options, options, _args|
12
23
  puts JSON.dump($client.chat_delete(options))
13
24
  end
14
25
  end
15
26
 
27
+ g.desc 'Retrieve a permalink URL for a specific extant message'
28
+ g.long_desc %( Retrieve a permalink URL for a specific extant message )
29
+ g.command 'getPermalink' do |c|
30
+ c.flag 'channel', desc: 'The ID of the conversation or channel containing the message.'
31
+ c.flag 'message_ts', desc: "A message's ts value, uniquely identifying it within a channel."
32
+ c.action do |_global_options, options, _args|
33
+ puts JSON.dump($client.chat_getPermalink(options))
34
+ end
35
+ end
36
+
16
37
  g.desc 'Share a me message into a channel.'
17
38
  g.long_desc %( Share a me message into a channel. )
18
39
  g.command 'meMessage' do |c|
@@ -77,10 +98,10 @@ command 'chat' do |g|
77
98
  g.long_desc %( Updates a message. )
78
99
  g.command 'update' do |c|
79
100
  c.flag 'channel', desc: 'Channel containing the message to be updated.'
80
- c.flag 'text', desc: 'New text for the message, using the default formatting rules.'
101
+ c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting attachments."
81
102
  c.flag 'ts', desc: 'Timestamp of the message to be updated.'
82
103
  c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
83
- c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
104
+ 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.'
84
105
  c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. This parameter should be used in conjunction with parse. To set link_names to 1, specify a parse mode of full.'
85
106
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
86
107
  c.action do |_global_options, options, _args|
@@ -0,0 +1,14 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ desc 'Dialog methods.'
4
+ command 'dialog' do |g|
5
+ g.desc 'Open a dialog with a user'
6
+ g.long_desc %( Open a dialog with a user )
7
+ g.command 'open' do |c|
8
+ c.flag 'dialog', desc: 'The dialog definition. This must be a JSON-encoded string.'
9
+ c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
10
+ c.action do |_global_options, options, _args|
11
+ puts JSON.dump($client.dialog_open(options))
12
+ end
13
+ end
14
+ end
@@ -11,6 +11,17 @@ command 'files' do |g|
11
11
  end
12
12
  end
13
13
 
14
+ g.desc 'Change the properties of a file (undocumented)'
15
+ g.long_desc %( Change the properties of a file )
16
+ g.command 'edit' do |c|
17
+ c.flag 'file', desc: 'ID of the file to be edited'
18
+ c.flag 'title', desc: 'New title of the file'
19
+ c.flag 'filetype', desc: 'New filetype of the file. See https://api.slack.com/types/file#file_types for a list of all supported types.'
20
+ c.action do |_global_options, options, _args|
21
+ puts JSON.dump($client.files_edit(options))
22
+ end
23
+ end
24
+
14
25
  g.desc 'Gets information about a team file.'
15
26
  g.long_desc %( Gets information about a team file. )
16
27
  g.command 'info' do |c|
@@ -54,6 +65,16 @@ You can pass multiple values in the types argument, like types=spaces,snippets.T
54
65
  end
55
66
  end
56
67
 
68
+ g.desc 'Share an existing file in a channel (undocumented)'
69
+ g.long_desc %( Share an existing file in a channel )
70
+ g.command 'share' do |c|
71
+ c.flag 'file', desc: 'ID of the file to be shared'
72
+ c.flag 'channel', desc: 'Channel to share the file in. Works with both public (channel ID) and private channels (group ID).'
73
+ c.action do |_global_options, options, _args|
74
+ puts JSON.dump($client.files_share(options))
75
+ end
76
+ end
77
+
57
78
  g.desc 'Enables a file for public/external sharing.'
58
79
  g.long_desc %( Enables a file for public/external sharing. )
59
80
  g.command 'sharedPublicURL' do |c|
@@ -43,6 +43,15 @@ command 'groups' do |g|
43
43
  end
44
44
  end
45
45
 
46
+ g.desc 'This method returns the ID of a group.'
47
+ g.long_desc %( This method returns the ID of a group. )
48
+ g.command 'id' do |c|
49
+ c.flag 'channel', desc: 'Group channel to get ID for, prefixed with #.'
50
+ c.action do |_global_options, options, _args|
51
+ puts JSON.dump($client.groups_id(options))
52
+ end
53
+ end
54
+
46
55
  g.desc 'Gets information about a private channel.'
47
56
  g.long_desc %( Gets information about a private channel. )
48
57
  g.command 'info' do |c|
@@ -86,7 +95,7 @@ command 'groups' do |g|
86
95
  g.long_desc %( Lists private channels that the calling user has access to. )
87
96
  g.command 'list' do |c|
88
97
  c.flag 'exclude_archived', desc: "Don't return archived private channels."
89
- c.flag 'exclude_members', desc: 'Exlude the members from each group.'
98
+ c.flag 'exclude_members', desc: 'Exclude the members from each group.'
90
99
  c.action do |_global_options, options, _args|
91
100
  puts JSON.dump($client.groups_list(options))
92
101
  end
@@ -160,13 +169,4 @@ command 'groups' do |g|
160
169
  puts JSON.dump($client.groups_unarchive(options))
161
170
  end
162
171
  end
163
-
164
- g.desc 'This method returns the ID of a group.'
165
- g.long_desc %( This method returns the ID of a group. )
166
- g.command 'id' do |c|
167
- c.flag 'channel', desc: 'Group channel to get ID for, prefixed with #.'
168
- c.action do |_global_options, options, _args|
169
- puts JSON.dump($client.groups_id(options))
170
- end
171
- end
172
172
  end
@@ -0,0 +1,14 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ desc 'Migration methods.'
4
+ command 'migration' do |g|
5
+ g.desc 'For Enterprise Grid workspaces, map local user IDs to global user IDs'
6
+ g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs )
7
+ g.command 'exchange' do |c|
8
+ c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.'
9
+ c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.'
10
+ c.action do |_global_options, options, _args|
11
+ puts JSON.dump($client.migration_exchange(options))
12
+ end
13
+ end
14
+ end
data/bin/commands/rtm.rb CHANGED
@@ -5,8 +5,7 @@ command 'rtm' do |g|
5
5
  g.desc 'Starts a Real Time Messaging session.'
6
6
  g.long_desc %( Starts a Real Time Messaging session. )
7
7
  g.command 'connect' do |c|
8
- c.flag 'batch_presence_aware', desc: 'Group presence change notices as presence_change_batch events when possible. See batching.'
9
- c.flag 'presence_sub', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
8
+ c.flag 'batch_presence_aware', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
10
9
  c.action do |_global_options, options, _args|
11
10
  puts JSON.dump($client.rtm_connect(options))
12
11
  end
@@ -15,12 +14,11 @@ command 'rtm' do |g|
15
14
  g.desc 'Starts a Real Time Messaging session.'
16
15
  g.long_desc %( Starts a Real Time Messaging session. )
17
16
  g.command 'start' do |c|
18
- c.flag 'batch_presence_aware', desc: 'Group presence change notices as presence_change_batch events when possible. See batching.'
17
+ c.flag 'batch_presence_aware', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
19
18
  c.flag 'include_locale', desc: 'Set this to true to receive the locale for users and channels. Defaults to false.'
20
19
  c.flag 'mpim_aware', desc: 'Returns MPIMs to the client in the API response.'
21
20
  c.flag 'no_latest', desc: 'Exclude latest timestamps for channels, groups, mpims, and ims. Automatically sets no_unreads to 1.'
22
21
  c.flag 'no_unreads', desc: 'Skip unread counts for each channel (improves performance).'
23
- c.flag 'presence_sub', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
24
22
  c.flag 'simple_latest', desc: 'Return timestamp only for latest message object of each channel (improves performance).'
25
23
  c.action do |_global_options, options, _args|
26
24
  puts JSON.dump($client.rtm_start(options))