slack-ruby-client 0.9.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 +40 -39
- data/.travis.yml +1 -9
- data/CHANGELOG.md +24 -0
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +3 -1
- data/README.md +40 -12
- data/Rakefile +1 -1
- data/UPGRADING.md +1 -1
- data/bin/commands/api.rb +2 -2
- data/bin/commands/apps_permissions.rb +22 -0
- data/bin/commands/auth.rb +4 -4
- data/bin/commands/bots.rb +2 -2
- data/bin/commands/channels.rb +52 -40
- data/bin/commands/chat.rb +63 -25
- data/bin/commands/conversations.rb +178 -0
- data/bin/commands/dialog.rb +14 -0
- data/bin/commands/dnd.rb +8 -8
- data/bin/commands/emoji.rb +2 -2
- data/bin/commands/files.rb +38 -17
- data/bin/commands/files_comments.rb +6 -6
- data/bin/commands/groups.rb +44 -51
- data/bin/commands/im.rb +16 -13
- data/bin/commands/migration.rb +14 -0
- data/bin/commands/mpim.rb +11 -11
- data/bin/commands/oauth.rb +15 -2
- data/bin/commands/pins.rb +6 -6
- data/bin/commands/reactions.rb +13 -13
- data/bin/commands/reminders.rb +10 -10
- data/bin/commands/rtm.rb +9 -6
- data/bin/commands/search.rb +9 -9
- data/bin/commands/stars.rb +8 -8
- data/bin/commands/team.rb +10 -10
- data/bin/commands/team_profile.rb +2 -2
- data/bin/commands/usergroups.rb +16 -16
- data/bin/commands/usergroups_users.rb +4 -4
- data/bin/commands/users.rb +40 -36
- data/bin/commands/users_admin.rb +28 -0
- data/bin/commands/users_prefs.rb +12 -0
- data/bin/commands/users_profile.rb +7 -7
- data/bin/commands.rb +7 -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 +11 -10
- data/lib/slack/real_time/concurrency/celluloid.rb +6 -2
- 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 +92 -72
- data/lib/slack/real_time/stores/store.rb +120 -90
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/api.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_permissions.rb +35 -0
- data/lib/slack/web/api/endpoints/auth.rb +4 -4
- data/lib/slack/web/api/endpoints/bots.rb +2 -2
- data/lib/slack/web/api/endpoints/channels.rb +57 -34
- data/lib/slack/web/api/endpoints/chat.rb +107 -37
- data/lib/slack/web/api/endpoints/conversations.rb +301 -0
- data/lib/slack/web/api/endpoints/dialog.rb +32 -0
- data/lib/slack/web/api/endpoints/dnd.rb +9 -9
- data/lib/slack/web/api/endpoints/emoji.rb +2 -2
- data/lib/slack/web/api/endpoints/files.rb +53 -23
- data/lib/slack/web/api/endpoints/files_comments.rb +11 -11
- data/lib/slack/web/api/endpoints/groups.rb +38 -50
- data/lib/slack/web/api/endpoints/im.rb +27 -17
- data/lib/slack/web/api/endpoints/migration.rb +25 -0
- data/lib/slack/web/api/endpoints/mpim.rb +13 -15
- data/lib/slack/web/api/endpoints/oauth.rb +24 -3
- data/lib/slack/web/api/endpoints/pins.rb +6 -8
- data/lib/slack/web/api/endpoints/presence.rb +1 -1
- data/lib/slack/web/api/endpoints/reactions.rb +18 -20
- data/lib/slack/web/api/endpoints/reminders.rb +10 -10
- data/lib/slack/web/api/endpoints/rtm.rb +14 -8
- data/lib/slack/web/api/endpoints/search.rb +12 -12
- data/lib/slack/web/api/endpoints/stars.rb +10 -12
- data/lib/slack/web/api/endpoints/team.rb +12 -13
- data/lib/slack/web/api/endpoints/team_profile.rb +2 -2
- data/lib/slack/web/api/endpoints/usergroups.rb +22 -22
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -4
- data/lib/slack/web/api/endpoints/users.rb +34 -24
- 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 +10 -10
- data/lib/slack/web/api/endpoints.rb +14 -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 +4 -3
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +17 -0
- data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
- data/lib/slack/web/api/templates/command.erb +4 -3
- 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 +18 -3
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +16 -12
- data/lib/slack/web/faraday/connection.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +3 -3
- data/lib/slack/web/pagination/cursor.rb +48 -0
- data/lib/slack-ruby-client.rb +6 -0
- 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/fixtures/slack/web/paginated_users_list.yml +181 -0
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/messages/formatting_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +62 -63
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +41 -31
- 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/apps_permissions_spec.rb +15 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +100 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +37 -1
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +16 -6
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/files_spec.rb +16 -5
- data/spec/slack/web/api/endpoints/migration_spec.rb +12 -0
- data/spec/slack/web/api/endpoints/oauth_spec.rb +11 -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/slack/web/api/pagination/cursor_spec.rb +70 -0
- data/spec/support/queue_with_timeout.rb +1 -1
- data/spec/support/real_time/concurrency/mock.rb +1 -2
- metadata +47 -30
data/bin/commands/groups.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc "Get info on your team's private channels."
|
4
4
|
command 'groups' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Archives a private channel.'
|
6
|
+
g.long_desc %( Archives a private channel. )
|
7
7
|
g.command 'archive' do |c|
|
8
8
|
c.flag 'channel', desc: 'Private channel to archive.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,17 +11,8 @@ command 'groups' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
16
|
-
g.command 'close' do |c|
|
17
|
-
c.flag 'channel', desc: 'Private channel to close.'
|
18
|
-
c.action do |_global_options, options, _args|
|
19
|
-
puts JSON.dump($client.groups_close(options))
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
g.desc 'This method creates a private channel.'
|
24
|
-
g.long_desc %( This method creates a private channel. )
|
14
|
+
g.desc 'Creates a private channel.'
|
15
|
+
g.long_desc %( Creates a private channel. )
|
25
16
|
g.command 'create' do |c|
|
26
17
|
c.flag 'name', desc: 'Name of private channel to create.'
|
27
18
|
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
@@ -30,8 +21,8 @@ command 'groups' do |g|
|
|
30
21
|
end
|
31
22
|
end
|
32
23
|
|
33
|
-
g.desc '
|
34
|
-
g.long_desc %(
|
24
|
+
g.desc 'Clones and archives a private channel.'
|
25
|
+
g.long_desc %( Clones and archives a private channel. )
|
35
26
|
g.command 'createChild' do |c|
|
36
27
|
c.flag 'channel', desc: 'Private channel to clone and archive.'
|
37
28
|
c.action do |_global_options, options, _args|
|
@@ -39,30 +30,40 @@ command 'groups' do |g|
|
|
39
30
|
end
|
40
31
|
end
|
41
32
|
|
42
|
-
g.desc '
|
43
|
-
g.long_desc %(
|
33
|
+
g.desc 'Fetches history of messages and events from a private channel.'
|
34
|
+
g.long_desc %( Fetches history of messages and events from a private channel. )
|
44
35
|
g.command 'history' do |c|
|
45
36
|
c.flag 'channel', desc: 'Private channel to fetch history for.'
|
37
|
+
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
46
38
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
47
39
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
48
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
49
40
|
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
50
41
|
c.action do |_global_options, options, _args|
|
51
42
|
puts JSON.dump($client.groups_history(options))
|
52
43
|
end
|
53
44
|
end
|
54
45
|
|
55
|
-
g.desc 'This method returns
|
56
|
-
g.long_desc %( This method returns
|
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
|
+
|
55
|
+
g.desc 'Gets information about a private channel.'
|
56
|
+
g.long_desc %( Gets information about a private channel. )
|
57
57
|
g.command 'info' do |c|
|
58
58
|
c.flag 'channel', desc: 'Private channel to get info on.'
|
59
|
+
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this group. Defaults to false.'
|
59
60
|
c.action do |_global_options, options, _args|
|
60
61
|
puts JSON.dump($client.groups_info(options))
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
64
|
-
g.desc '
|
65
|
-
g.long_desc %(
|
65
|
+
g.desc 'Invites a user to a private channel.'
|
66
|
+
g.long_desc %( Invites a user to a private channel. )
|
66
67
|
g.command 'invite' do |c|
|
67
68
|
c.flag 'channel', desc: 'Private channel to invite user to.'
|
68
69
|
c.flag 'user', desc: 'User to invite.'
|
@@ -71,8 +72,8 @@ command 'groups' do |g|
|
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
74
|
-
g.desc '
|
75
|
-
g.long_desc %(
|
75
|
+
g.desc 'Removes a user from a private channel.'
|
76
|
+
g.long_desc %( Removes a user from a private channel. )
|
76
77
|
g.command 'kick' do |c|
|
77
78
|
c.flag 'channel', desc: 'Private channel to remove user from.'
|
78
79
|
c.flag 'user', desc: 'User to remove from private channel.'
|
@@ -81,8 +82,8 @@ command 'groups' do |g|
|
|
81
82
|
end
|
82
83
|
end
|
83
84
|
|
84
|
-
g.desc '
|
85
|
-
g.long_desc %(
|
85
|
+
g.desc 'Leaves a private channel.'
|
86
|
+
g.long_desc %( Leaves a private channel. )
|
86
87
|
g.command 'leave' do |c|
|
87
88
|
c.flag 'channel', desc: 'Private channel to leave.'
|
88
89
|
c.action do |_global_options, options, _args|
|
@@ -90,17 +91,18 @@ command 'groups' do |g|
|
|
90
91
|
end
|
91
92
|
end
|
92
93
|
|
93
|
-
g.desc '
|
94
|
-
g.long_desc %(
|
94
|
+
g.desc 'Lists private channels that the calling user has access to.'
|
95
|
+
g.long_desc %( Lists private channels that the calling user has access to. )
|
95
96
|
g.command 'list' do |c|
|
96
97
|
c.flag 'exclude_archived', desc: "Don't return archived private channels."
|
98
|
+
c.flag 'exclude_members', desc: 'Exclude the members from each group.'
|
97
99
|
c.action do |_global_options, options, _args|
|
98
100
|
puts JSON.dump($client.groups_list(options))
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
102
|
-
g.desc '
|
103
|
-
g.long_desc %(
|
104
|
+
g.desc 'Sets the read cursor in a private channel.'
|
105
|
+
g.long_desc %( Sets the read cursor in a private channel. )
|
104
106
|
g.command 'mark' do |c|
|
105
107
|
c.flag 'channel', desc: 'Private channel to set reading cursor in.'
|
106
108
|
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
@@ -109,8 +111,8 @@ command 'groups' do |g|
|
|
109
111
|
end
|
110
112
|
end
|
111
113
|
|
112
|
-
g.desc '
|
113
|
-
g.long_desc %(
|
114
|
+
g.desc 'Opens a private channel.'
|
115
|
+
g.long_desc %( Opens a private channel. )
|
114
116
|
g.command 'open' do |c|
|
115
117
|
c.flag 'channel', desc: 'Private channel to open.'
|
116
118
|
c.action do |_global_options, options, _args|
|
@@ -118,8 +120,8 @@ command 'groups' do |g|
|
|
118
120
|
end
|
119
121
|
end
|
120
122
|
|
121
|
-
g.desc '
|
122
|
-
g.long_desc %(
|
123
|
+
g.desc 'Renames a private channel.'
|
124
|
+
g.long_desc %( Renames a private channel. )
|
123
125
|
g.command 'rename' do |c|
|
124
126
|
c.flag 'channel', desc: 'Private channel to rename.'
|
125
127
|
c.flag 'name', desc: 'New name for private channel.'
|
@@ -129,8 +131,8 @@ command 'groups' do |g|
|
|
129
131
|
end
|
130
132
|
end
|
131
133
|
|
132
|
-
g.desc '
|
133
|
-
g.long_desc %(
|
134
|
+
g.desc 'Retrieve a thread of messages posted to a private channel'
|
135
|
+
g.long_desc %( Retrieve a thread of messages posted to a private channel )
|
134
136
|
g.command 'replies' do |c|
|
135
137
|
c.flag 'channel', desc: 'Private channel to fetch thread from.'
|
136
138
|
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
@@ -139,8 +141,8 @@ command 'groups' do |g|
|
|
139
141
|
end
|
140
142
|
end
|
141
143
|
|
142
|
-
g.desc '
|
143
|
-
g.long_desc %(
|
144
|
+
g.desc 'Sets the purpose for a private channel.'
|
145
|
+
g.long_desc %( Sets the purpose for a private channel. )
|
144
146
|
g.command 'setPurpose' do |c|
|
145
147
|
c.flag 'channel', desc: 'Private channel to set the purpose of.'
|
146
148
|
c.flag 'purpose', desc: 'The new purpose.'
|
@@ -149,8 +151,8 @@ command 'groups' do |g|
|
|
149
151
|
end
|
150
152
|
end
|
151
153
|
|
152
|
-
g.desc '
|
153
|
-
g.long_desc %(
|
154
|
+
g.desc 'Sets the topic for a private channel.'
|
155
|
+
g.long_desc %( Sets the topic for a private channel. )
|
154
156
|
g.command 'setTopic' do |c|
|
155
157
|
c.flag 'channel', desc: 'Private channel to set the topic of.'
|
156
158
|
c.flag 'topic', desc: 'The new topic.'
|
@@ -159,21 +161,12 @@ command 'groups' do |g|
|
|
159
161
|
end
|
160
162
|
end
|
161
163
|
|
162
|
-
g.desc '
|
163
|
-
g.long_desc %(
|
164
|
+
g.desc 'Unarchives a private channel.'
|
165
|
+
g.long_desc %( Unarchives a private channel. )
|
164
166
|
g.command 'unarchive' do |c|
|
165
167
|
c.flag 'channel', desc: 'Private channel to unarchive.'
|
166
168
|
c.action do |_global_options, options, _args|
|
167
169
|
puts JSON.dump($client.groups_unarchive(options))
|
168
170
|
end
|
169
171
|
end
|
170
|
-
|
171
|
-
g.desc 'This method returns the ID of a group.'
|
172
|
-
g.long_desc %( This method returns the ID of a group. )
|
173
|
-
g.command 'id' do |c|
|
174
|
-
c.flag 'channel', desc: 'Group channel to get ID for, prefixed with #.'
|
175
|
-
c.action do |_global_options, options, _args|
|
176
|
-
puts JSON.dump($client.groups_id(options))
|
177
|
-
end
|
178
|
-
end
|
179
172
|
end
|
data/bin/commands/im.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Get info on your direct messages.'
|
4
4
|
command 'im' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Close a direct message channel.'
|
6
|
+
g.long_desc %( Close a direct message channel. )
|
7
7
|
g.command 'close' do |c|
|
8
8
|
c.flag 'channel', desc: 'Direct message channel to close.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,29 +11,31 @@ command 'im' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Fetches history of messages and events from direct message channel.'
|
15
|
+
g.long_desc %( Fetches history of messages and events from direct message channel. )
|
16
16
|
g.command 'history' do |c|
|
17
17
|
c.flag 'channel', desc: 'Direct message channel to fetch history for.'
|
18
|
+
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
18
19
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
19
20
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
20
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
21
21
|
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
22
22
|
c.action do |_global_options, options, _args|
|
23
23
|
puts JSON.dump($client.im_history(options))
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
g.desc '
|
28
|
-
g.long_desc %(
|
27
|
+
g.desc 'Lists direct message channels for the calling user.'
|
28
|
+
g.long_desc %( Lists direct message channels for the calling user. )
|
29
29
|
g.command 'list' do |c|
|
30
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
|
31
|
+
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached."
|
30
32
|
c.action do |_global_options, options, _args|
|
31
33
|
puts JSON.dump($client.im_list(options))
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
35
|
-
g.desc '
|
36
|
-
g.long_desc %(
|
37
|
+
g.desc 'Sets the read cursor in a direct message channel.'
|
38
|
+
g.long_desc %( Sets the read cursor in a direct message channel. )
|
37
39
|
g.command 'mark' do |c|
|
38
40
|
c.flag 'channel', desc: 'Direct message channel to set reading cursor in.'
|
39
41
|
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
@@ -42,18 +44,19 @@ command 'im' do |g|
|
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
45
|
-
g.desc '
|
46
|
-
g.long_desc %(
|
47
|
+
g.desc 'Opens a direct message channel.'
|
48
|
+
g.long_desc %( Opens a direct message channel. )
|
47
49
|
g.command 'open' do |c|
|
48
50
|
c.flag 'user', desc: 'User to open a direct message channel with.'
|
51
|
+
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this im. Defaults to false.'
|
49
52
|
c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
|
50
53
|
c.action do |_global_options, options, _args|
|
51
54
|
puts JSON.dump($client.im_open(options))
|
52
55
|
end
|
53
56
|
end
|
54
57
|
|
55
|
-
g.desc '
|
56
|
-
g.long_desc %(
|
58
|
+
g.desc 'Retrieve a thread of messages posted to a direct message conversation'
|
59
|
+
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation )
|
57
60
|
g.command 'replies' do |c|
|
58
61
|
c.flag 'channel', desc: 'Direct message channel to fetch thread from.'
|
59
62
|
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
@@ -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/mpim.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Get info on your multiparty direct messages.'
|
4
4
|
command 'mpim' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Closes a multiparty direct message channel.'
|
6
|
+
g.long_desc %( Closes a multiparty direct message channel. )
|
7
7
|
g.command 'close' do |c|
|
8
8
|
c.flag 'channel', desc: 'MPIM to close.'
|
9
9
|
c.action do |_global_options, options, _args|
|
@@ -11,29 +11,29 @@ command 'mpim' do |g|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
g.desc '
|
15
|
-
g.long_desc %(
|
14
|
+
g.desc 'Fetches history of messages and events from a multiparty direct message.'
|
15
|
+
g.long_desc %( Fetches history of messages and events from a multiparty direct message. )
|
16
16
|
g.command 'history' do |c|
|
17
17
|
c.flag 'channel', desc: 'Multiparty direct message to fetch history for.'
|
18
|
+
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
18
19
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
19
20
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
20
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
21
21
|
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
22
22
|
c.action do |_global_options, options, _args|
|
23
23
|
puts JSON.dump($client.mpim_history(options))
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
g.desc '
|
28
|
-
g.long_desc %(
|
27
|
+
g.desc 'Lists multiparty direct message channels for the calling user.'
|
28
|
+
g.long_desc %( Lists multiparty direct message channels for the calling user. )
|
29
29
|
g.command 'list' do |c|
|
30
30
|
c.action do |_global_options, options, _args|
|
31
31
|
puts JSON.dump($client.mpim_list(options))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
g.desc '
|
36
|
-
g.long_desc %(
|
35
|
+
g.desc 'Sets the read cursor in a multiparty direct message channel.'
|
36
|
+
g.long_desc %( Sets the read cursor in a multiparty direct message channel. )
|
37
37
|
g.command 'mark' do |c|
|
38
38
|
c.flag 'channel', desc: 'multiparty direct message channel to set reading cursor in.'
|
39
39
|
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
@@ -51,8 +51,8 @@ command 'mpim' do |g|
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
g.desc '
|
55
|
-
g.long_desc %(
|
54
|
+
g.desc 'Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.'
|
55
|
+
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message. )
|
56
56
|
g.command 'replies' do |c|
|
57
57
|
c.flag 'channel', desc: 'Multiparty direct message channel to fetch thread from.'
|
58
58
|
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
data/bin/commands/oauth.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Oauth methods.'
|
4
4
|
command 'oauth' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Exchanges a temporary OAuth code for an API token.'
|
6
|
+
g.long_desc %( Exchanges a temporary OAuth code for an API token. )
|
7
7
|
g.command 'access' do |c|
|
8
8
|
c.flag 'client_id', desc: 'Issued when you created your application.'
|
9
9
|
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
@@ -13,4 +13,17 @@ command 'oauth' do |g|
|
|
13
13
|
puts JSON.dump($client.oauth_access(options))
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
g.desc 'Exchanges a temporary OAuth verifier code for a workspace token.'
|
18
|
+
g.long_desc %( Exchanges a temporary OAuth verifier code for a workspace token. )
|
19
|
+
g.command 'token' do |c|
|
20
|
+
c.flag 'client_id', desc: 'Issued when you created your application.'
|
21
|
+
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
22
|
+
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
23
|
+
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
24
|
+
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel.'
|
25
|
+
c.action do |_global_options, options, _args|
|
26
|
+
puts JSON.dump($client.oauth_token(options))
|
27
|
+
end
|
28
|
+
end
|
16
29
|
end
|
data/bin/commands/pins.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Pins methods.'
|
4
4
|
command 'pins' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Pins an item to a channel.'
|
6
|
+
g.long_desc %( Pins an item to a channel. )
|
7
7
|
g.command 'add' do |c|
|
8
8
|
c.flag 'channel', desc: 'Channel to pin the item in.'
|
9
9
|
c.flag 'file', desc: 'File to pin.'
|
@@ -14,8 +14,8 @@ command 'pins' do |g|
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
g.desc '
|
18
|
-
g.long_desc %(
|
17
|
+
g.desc 'Lists items pinned to a channel.'
|
18
|
+
g.long_desc %( Lists items pinned to a channel. )
|
19
19
|
g.command 'list' do |c|
|
20
20
|
c.flag 'channel', desc: 'Channel to get pinned items for.'
|
21
21
|
c.action do |_global_options, options, _args|
|
@@ -23,8 +23,8 @@ command 'pins' do |g|
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
g.desc '
|
27
|
-
g.long_desc %(
|
26
|
+
g.desc 'Un-pins an item from a channel.'
|
27
|
+
g.long_desc %( Un-pins an item from a channel. )
|
28
28
|
g.command 'remove' do |c|
|
29
29
|
c.flag 'channel', desc: 'Channel where the item is pinned to.'
|
30
30
|
c.flag 'file', desc: 'File to un-pin.'
|
data/bin/commands/reactions.rb
CHANGED
@@ -2,49 +2,49 @@
|
|
2
2
|
|
3
3
|
desc 'Reactions methods.'
|
4
4
|
command 'reactions' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Adds a reaction to an item.'
|
6
|
+
g.long_desc %( Adds a reaction to an item. )
|
7
7
|
g.command 'add' do |c|
|
8
8
|
c.flag 'name', desc: 'Reaction (emoji) name.'
|
9
|
+
c.flag 'channel', desc: 'Channel where the message to add reaction to was posted.'
|
9
10
|
c.flag 'file', desc: 'File to add reaction to.'
|
10
11
|
c.flag 'file_comment', desc: 'File comment to add reaction to.'
|
11
|
-
c.flag 'channel', desc: 'Channel where the message to add reaction to was posted.'
|
12
12
|
c.flag 'timestamp', desc: 'Timestamp of the message to add reaction to.'
|
13
13
|
c.action do |_global_options, options, _args|
|
14
14
|
puts JSON.dump($client.reactions_add(options))
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
g.desc '
|
19
|
-
g.long_desc %(
|
18
|
+
g.desc 'Gets reactions for an item.'
|
19
|
+
g.long_desc %( Gets reactions for an item. )
|
20
20
|
g.command 'get' do |c|
|
21
|
+
c.flag 'channel', desc: 'Channel where the message to get reactions for was posted.'
|
21
22
|
c.flag 'file', desc: 'File to get reactions for.'
|
22
23
|
c.flag 'file_comment', desc: 'File comment to get reactions for.'
|
23
|
-
c.flag 'channel', desc: 'Channel where the message to get reactions for was posted.'
|
24
|
-
c.flag 'timestamp', desc: 'Timestamp of the message to get reactions for.'
|
25
24
|
c.flag 'full', desc: 'If true always return the complete reaction list.'
|
25
|
+
c.flag 'timestamp', desc: 'Timestamp of the message to get reactions for.'
|
26
26
|
c.action do |_global_options, options, _args|
|
27
27
|
puts JSON.dump($client.reactions_get(options))
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
g.desc '
|
32
|
-
g.long_desc %(
|
31
|
+
g.desc 'Lists reactions made by a user.'
|
32
|
+
g.long_desc %( Lists reactions made by a user. )
|
33
33
|
g.command 'list' do |c|
|
34
|
-
c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
|
35
34
|
c.flag 'full', desc: 'If true always return the complete reaction list.'
|
35
|
+
c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
|
36
36
|
c.action do |_global_options, options, _args|
|
37
37
|
puts JSON.dump($client.reactions_list(options))
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
g.desc '
|
42
|
-
g.long_desc %(
|
41
|
+
g.desc 'Removes a reaction from an item.'
|
42
|
+
g.long_desc %( Removes a reaction from an item. )
|
43
43
|
g.command 'remove' do |c|
|
44
44
|
c.flag 'name', desc: 'Reaction (emoji) name.'
|
45
|
+
c.flag 'channel', desc: 'Channel where the message to remove reaction from was posted.'
|
45
46
|
c.flag 'file', desc: 'File to remove reaction from.'
|
46
47
|
c.flag 'file_comment', desc: 'File comment to remove reaction from.'
|
47
|
-
c.flag 'channel', desc: 'Channel where the message to remove reaction from was posted.'
|
48
48
|
c.flag 'timestamp', desc: 'Timestamp of the message to remove reaction from.'
|
49
49
|
c.action do |_global_options, options, _args|
|
50
50
|
puts JSON.dump($client.reactions_remove(options))
|
data/bin/commands/reminders.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
desc 'Reminders methods.'
|
4
4
|
command 'reminders' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Creates a reminder.'
|
6
|
+
g.long_desc %( Creates a reminder. )
|
7
7
|
g.command 'add' do |c|
|
8
8
|
c.flag 'text', desc: 'The content of the reminder.'
|
9
9
|
c.flag 'time', desc: 'When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").'
|
@@ -13,8 +13,8 @@ command 'reminders' do |g|
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
g.desc '
|
17
|
-
g.long_desc %(
|
16
|
+
g.desc 'Marks a reminder as complete.'
|
17
|
+
g.long_desc %( Marks a reminder as complete. )
|
18
18
|
g.command 'complete' do |c|
|
19
19
|
c.flag 'reminder', desc: 'The ID of the reminder to be marked as complete.'
|
20
20
|
c.action do |_global_options, options, _args|
|
@@ -22,8 +22,8 @@ command 'reminders' do |g|
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
g.desc '
|
26
|
-
g.long_desc %(
|
25
|
+
g.desc 'Deletes a reminder.'
|
26
|
+
g.long_desc %( Deletes a reminder. )
|
27
27
|
g.command 'delete' do |c|
|
28
28
|
c.flag 'reminder', desc: 'The ID of the reminder.'
|
29
29
|
c.action do |_global_options, options, _args|
|
@@ -31,8 +31,8 @@ command 'reminders' do |g|
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
g.desc '
|
35
|
-
g.long_desc %(
|
34
|
+
g.desc 'Gets information about a reminder.'
|
35
|
+
g.long_desc %( Gets information about a reminder. )
|
36
36
|
g.command 'info' do |c|
|
37
37
|
c.flag 'reminder', desc: 'The ID of the reminder.'
|
38
38
|
c.action do |_global_options, options, _args|
|
@@ -40,8 +40,8 @@ command 'reminders' do |g|
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
g.desc '
|
44
|
-
g.long_desc %(
|
43
|
+
g.desc 'Lists all reminders created by or for a given user.'
|
44
|
+
g.long_desc %( Lists all reminders created by or for a given user. )
|
45
45
|
g.command 'list' do |c|
|
46
46
|
c.action do |_global_options, options, _args|
|
47
47
|
puts JSON.dump($client.reminders_list(options))
|
data/bin/commands/rtm.rb
CHANGED
@@ -2,21 +2,24 @@
|
|
2
2
|
|
3
3
|
desc 'Rtm methods.'
|
4
4
|
command 'rtm' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Starts a Real Time Messaging session.'
|
6
|
+
g.long_desc %( Starts a Real Time Messaging session. )
|
7
7
|
g.command 'connect' do |c|
|
8
|
+
c.flag 'batch_presence_aware', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
|
8
9
|
c.action do |_global_options, options, _args|
|
9
10
|
puts JSON.dump($client.rtm_connect(options))
|
10
11
|
end
|
11
12
|
end
|
12
13
|
|
13
|
-
g.desc '
|
14
|
-
g.long_desc %(
|
14
|
+
g.desc 'Starts a Real Time Messaging session.'
|
15
|
+
g.long_desc %( Starts a Real Time Messaging session. )
|
15
16
|
g.command 'start' do |c|
|
16
|
-
c.flag '
|
17
|
-
c.flag '
|
17
|
+
c.flag 'batch_presence_aware', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
|
18
|
+
c.flag 'include_locale', desc: 'Set this to true to receive the locale for users and channels. Defaults to false.'
|
18
19
|
c.flag 'mpim_aware', desc: 'Returns MPIMs to the client in the API response.'
|
19
20
|
c.flag 'no_latest', desc: 'Exclude latest timestamps for channels, groups, mpims, and ims. Automatically sets no_unreads to 1.'
|
21
|
+
c.flag 'no_unreads', desc: 'Skip unread counts for each channel (improves performance).'
|
22
|
+
c.flag 'simple_latest', desc: 'Return timestamp only for latest message object of each channel (improves performance).'
|
20
23
|
c.action do |_global_options, options, _args|
|
21
24
|
puts JSON.dump($client.rtm_start(options))
|
22
25
|
end
|
data/bin/commands/search.rb
CHANGED
@@ -2,37 +2,37 @@
|
|
2
2
|
|
3
3
|
desc "Search your team's files and messages."
|
4
4
|
command 'search' do |g|
|
5
|
-
g.desc '
|
6
|
-
g.long_desc %(
|
5
|
+
g.desc 'Searches for messages and files matching a query.'
|
6
|
+
g.long_desc %( Searches for messages and files matching a query. )
|
7
7
|
g.command 'all' do |c|
|
8
8
|
c.flag 'query', desc: 'Search query. May contains booleans, etc.'
|
9
|
+
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
9
10
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
10
11
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
11
|
-
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
12
12
|
c.action do |_global_options, options, _args|
|
13
13
|
puts JSON.dump($client.search_all(options))
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
g.desc '
|
18
|
-
g.long_desc %(
|
17
|
+
g.desc 'Searches for files matching a query.'
|
18
|
+
g.long_desc %( Searches for files matching a query. )
|
19
19
|
g.command 'files' do |c|
|
20
20
|
c.flag 'query', desc: 'Search query. May contain booleans, etc.'
|
21
|
+
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
21
22
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
22
23
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
23
|
-
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
24
24
|
c.action do |_global_options, options, _args|
|
25
25
|
puts JSON.dump($client.search_files(options))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
g.desc '
|
30
|
-
g.long_desc %(
|
29
|
+
g.desc 'Searches for messages matching a query.'
|
30
|
+
g.long_desc %( Searches for messages matching a query. )
|
31
31
|
g.command 'messages' do |c|
|
32
32
|
c.flag 'query', desc: 'Search query. May contains booleans, etc.'
|
33
|
+
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
33
34
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
34
35
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
35
|
-
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
36
36
|
c.action do |_global_options, options, _args|
|
37
37
|
puts JSON.dump($client.search_messages(options))
|
38
38
|
end
|