slack-ruby-client 0.10.0 → 0.11.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +30 -34
- data/.travis.yml +0 -1
- data/CHANGELOG.md +9 -0
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +3 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/bin/commands/channels.rb +18 -9
- data/bin/commands/chat.rb +24 -3
- data/bin/commands/dialog.rb +14 -0
- data/bin/commands/files.rb +21 -0
- data/bin/commands/groups.rb +10 -10
- data/bin/commands/migration.rb +14 -0
- data/bin/commands/rtm.rb +2 -4
- data/bin/commands/users.rb +18 -18
- data/bin/commands/users_admin.rb +28 -0
- data/bin/commands/users_prefs.rb +12 -0
- data/bin/commands.rb +5 -1
- data/bin/slack +1 -1
- data/examples/hi_real_time/hi.rb +1 -1
- data/examples/hi_real_time_and_web/hi.rb +1 -1
- data/examples/hi_real_time_async_celluloid/hi.rb +1 -1
- data/examples/hi_real_time_async_eventmachine/hi.rb +1 -1
- data/examples/hi_web/hi.rb +1 -1
- data/examples/new_ticket/new_ticket.rb +1 -1
- data/lib/slack/messages/formatting.rb +4 -4
- data/lib/slack/messages/message.rb +1 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +1 -1
- data/lib/slack/real_time/client.rb +10 -9
- data/lib/slack/real_time/concurrency/celluloid.rb +5 -1
- data/lib/slack/real_time/config.rb +11 -11
- data/lib/slack/real_time/models/base.rb +1 -2
- data/lib/slack/real_time/socket.rb +2 -2
- data/lib/slack/real_time/stores/base.rb +1 -2
- data/lib/slack/real_time/stores/starter.rb +76 -76
- data/lib/slack/real_time/stores/store.rb +104 -94
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/api.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_permissions.rb +2 -2
- data/lib/slack/web/api/endpoints/auth.rb +2 -2
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/channels.rb +27 -15
- data/lib/slack/web/api/endpoints/chat.rb +42 -9
- data/lib/slack/web/api/endpoints/conversations.rb +17 -17
- data/lib/slack/web/api/endpoints/dialog.rb +32 -0
- data/lib/slack/web/api/endpoints/dnd.rb +5 -5
- data/lib/slack/web/api/endpoints/emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +37 -6
- data/lib/slack/web/api/endpoints/files_comments.rb +3 -3
- data/lib/slack/web/api/endpoints/groups.rb +17 -17
- data/lib/slack/web/api/endpoints/im.rb +6 -6
- data/lib/slack/web/api/endpoints/migration.rb +25 -0
- data/lib/slack/web/api/endpoints/mpim.rb +6 -6
- data/lib/slack/web/api/endpoints/oauth.rb +2 -2
- data/lib/slack/web/api/endpoints/pins.rb +3 -3
- data/lib/slack/web/api/endpoints/presence.rb +1 -1
- data/lib/slack/web/api/endpoints/reactions.rb +4 -4
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +3 -7
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/stars.rb +3 -3
- data/lib/slack/web/api/endpoints/team.rb +4 -4
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
- data/lib/slack/web/api/endpoints/users.rb +8 -8
- data/lib/slack/web/api/endpoints/users_admin.rb +46 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +19 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +2 -2
- data/lib/slack/web/api/endpoints.rb +10 -2
- data/lib/slack/web/api/mixins/ids.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.search.rb +38 -36
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +1 -1
- data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
- data/lib/slack/web/api/templates/command.erb +2 -1
- data/lib/slack/web/api/templates/commands.erb +1 -1
- data/lib/slack/web/api/templates/endpoints.erb +2 -2
- data/lib/slack/web/api/templates/method.erb +8 -3
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +12 -12
- data/lib/slack/web/faraday/response/raise_error.rb +3 -3
- data/lib/tasks/git.rake +1 -1
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +4 -1
- data/slack-ruby-client.gemspec +2 -3
- data/spec/slack/messages/formatting_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +3 -2
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +1 -1
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +1 -1
- data/spec/slack/real_time/event_handlers/bot_spec.rb +4 -2
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/user_spec.rb +4 -2
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +8 -6
- data/spec/slack/web/api/endpoints/files_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/migration_spec.rb +12 -0
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +17 -0
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +7 -0
- data/spec/slack/web/api/error_spec.rb +1 -1
- data/spec/slack/web/api/errors/slack_error_spec.rb +1 -1
- data/spec/slack/web/api/mixins/users_spec.rb +6 -4
- data/spec/support/queue_with_timeout.rb +1 -1
- data/spec/support/real_time/concurrency/mock.rb +1 -2
- metadata +34 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4523b02fb8e41e2a529f21283e9631aca6e04bb
|
4
|
+
data.tar.gz: 6324f7a54941b201b7aa729178418241accf836c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 958f43b8c6c3591d81761e60c310c6cf2638b26ab79b9bf56748768a2e8800fdad85733262c5a93d4272b3861f475b2cbb2f1eabb01fadb3a2848a09c82be3d7
|
7
|
+
data.tar.gz: 1787862cbf85c3cd762c8b044afd89d98c92ee0cd959aaf94da5b5d513cd3c24c3d8de005eece992a5f13ed76a8279231d40d8ade39dd32c4efe692c9118b79c
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
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-
|
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
|
-
|
18
|
-
# Configuration parameters: IgnoreEmptyBlocks.
|
19
|
-
Lint/UnusedBlockArgument:
|
17
|
+
Lint/RescueWithoutErrorClass:
|
20
18
|
Exclude:
|
21
|
-
- 'lib/slack/
|
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:
|
33
|
+
Max: 166
|
31
34
|
|
32
35
|
# Offense count: 4
|
33
36
|
Metrics/CyclomaticComplexity:
|
34
37
|
Max: 9
|
35
38
|
|
36
|
-
# Offense count:
|
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:
|
45
|
+
# Offense count: 10
|
42
46
|
# Configuration parameters: CountComments.
|
43
47
|
Metrics/MethodLength:
|
44
|
-
Max:
|
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:
|
62
|
-
|
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:
|
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:
|
72
|
-
# Configuration parameters:
|
73
|
-
Style/
|
74
|
-
|
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
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/
|
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
|
-
|
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.
|
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
data/bin/commands/channels.rb
CHANGED
@@ -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:
|
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
|
data/bin/commands/files.rb
CHANGED
@@ -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|
|
data/bin/commands/groups.rb
CHANGED
@@ -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: '
|
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: '
|
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: '
|
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))
|