slack-ruby-client 0.14.6 → 1.0.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/.github/FUNDING.yml +1 -0
- data/.rubocop.yml +15 -3
- data/.rubocop_todo.yml +110 -38
- data/.travis.yml +2 -5
- data/CHANGELOG.md +42 -0
- data/CONTRIBUTING.md +19 -8
- data/Dangerfile +1 -1
- data/Gemfile +1 -2
- data/LICENSE.md +1 -1
- data/README.md +38 -36
- data/RELEASING.md +1 -1
- data/UPGRADING.md +62 -2
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +26 -2
- data/bin/commands/admin_apps_requests.rb +1 -0
- data/bin/commands/admin_auth_policy.rb +39 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +155 -3
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
- data/bin/commands/admin_conversations_whitelist.rb +37 -0
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +3 -2
- data/bin/commands/admin_users_session.rb +62 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/apps_manifest.rb +51 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +1 -155
- data/bin/commands/chat.rb +17 -12
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +71 -3
- data/bin/commands/dnd.rb +2 -0
- data/bin/commands/files.rb +6 -4
- data/bin/commands/files_remote.rb +2 -2
- data/bin/commands/groups.rb +1 -162
- data/bin/commands/im.rb +1 -63
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +1 -61
- data/bin/commands/oauth.rb +0 -13
- data/bin/commands/oauth_v2.rb +13 -1
- data/bin/commands/openid_connect.rb +27 -0
- data/bin/commands/pins.rb +2 -4
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/reminders.rb +6 -0
- data/bin/commands/rtm.rb +2 -2
- data/bin/commands/search.rb +4 -0
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +3 -0
- data/bin/commands/team_billing.rb +13 -0
- data/bin/commands/team_preferences.rb +13 -0
- data/bin/commands/tooling_tokens.rb +14 -0
- data/bin/commands/usergroups.rb +5 -0
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +4 -2
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +2 -2
- data/bin/commands/workflows.rb +38 -0
- data/bin/commands.rb +17 -8
- data/lib/slack/config.rb +1 -2
- data/lib/slack/events/request.rb +10 -4
- data/lib/slack/messages/message.rb +0 -4
- data/lib/slack/real_time/client.rb +6 -6
- data/lib/slack/real_time/concurrency/async.rb +7 -11
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/config.rb +5 -14
- data/lib/slack/real_time/models/base.rb +0 -4
- data/lib/slack/real_time/socket.rb +3 -4
- data/lib/slack/real_time/stores/base.rb +4 -7
- data/lib/slack/real_time/stores/starter.rb +6 -3
- data/lib/slack/real_time/stores/store.rb +5 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +234 -4
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
- data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
- data/lib/slack/web/api/endpoints/api.rb +1 -3
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
- data/lib/slack/web/api/endpoints/auth.rb +1 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +3 -1
- data/lib/slack/web/api/endpoints/calls.rb +83 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
- data/lib/slack/web/api/endpoints/channels.rb +1 -245
- data/lib/slack/web/api/endpoints/chat.rb +76 -66
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -3
- data/lib/slack/web/api/endpoints/conversations.rb +149 -41
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +6 -3
- data/lib/slack/web/api/endpoints/files.rb +21 -17
- data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +23 -23
- data/lib/slack/web/api/endpoints/groups.rb +0 -253
- data/lib/slack/web/api/endpoints/im.rb +0 -101
- data/lib/slack/web/api/endpoints/migration.rb +4 -2
- data/lib/slack/web/api/endpoints/mpim.rb +0 -96
- data/lib/slack/web/api/endpoints/oauth.rb +5 -30
- data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
- data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
- data/lib/slack/web/api/endpoints/pins.rb +7 -12
- data/lib/slack/web/api/endpoints/reactions.rb +16 -14
- data/lib/slack/web/api/endpoints/reminders.rb +17 -5
- data/lib/slack/web/api/endpoints/rtm.rb +10 -10
- data/lib/slack/web/api/endpoints/search.rb +27 -13
- data/lib/slack/web/api/endpoints/stars.rb +13 -11
- data/lib/slack/web/api/endpoints/team.rb +11 -5
- data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
- data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
- data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
- data/lib/slack/web/api/endpoints/users.rb +20 -18
- data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
- data/lib/slack/web/api/endpoints/views.rb +13 -13
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/endpoints.rb +35 -18
- data/lib/slack/web/api/errors/server_error.rb +37 -0
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
- data/lib/slack/web/api/errors.rb +486 -12
- data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +3 -5
- data/lib/slack/web/api/mixins/ids.id.rb +3 -5
- data/lib/slack/web/api/mixins/users.id.rb +1 -3
- data/lib/slack/web/api/mixins.rb +1 -2
- data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +25 -24
- data/lib/slack/web/api/templates/endpoints.erb +1 -2
- data/lib/slack/web/api/templates/method.erb +4 -1
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +2 -0
- data/lib/slack/web/faraday/connection.rb +23 -20
- data/lib/slack/web/faraday/request.rb +2 -1
- data/lib/slack/web/faraday/response/raise_error.rb +12 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +3 -7
- data/lib/slack-ruby-client.rb +4 -4
- data/lib/tasks/web.rake +11 -3
- data/slack-ruby-client.gemspec +6 -7
- data/spec/fixtures/slack/web/429_error.yml +50 -54
- data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
- data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
- data/spec/fixtures/slack/web/conversations_info.yml +167 -0
- data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
- data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
- data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
- data/spec/fixtures/slack/web/rtm_start.yml +771 -60
- data/spec/fixtures/slack/web/users_info.yml +153 -69
- data/spec/fixtures/slack/web/users_list.yml +102 -41
- data/spec/fixtures/slack/web/views_open_error.yml +49 -42
- data/spec/slack/events/request_spec.rb +13 -8
- data/spec/slack/real_time/client_spec.rb +35 -22
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
- data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/slack_spec.rb +3 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
- data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -22
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
- data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/api/error_spec.rb +5 -7
- data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/{channels_spec.rb → conversations_spec.rb} +8 -8
- data/spec/slack/web/api/mixins/users_spec.rb +1 -1
- data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
- data/spec/slack/web/client_spec.rb +123 -1
- data/spec/slack/web/faraday/request_spec.rb +80 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
- data/spec/spec_helper.rb +1 -1
- data/spec/support/real_time/connected_client.rb +1 -7
- data/spec/support/vcr.rb +36 -1
- metadata +95 -173
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -27
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
- data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
- data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
- data/spec/fixtures/slack/web/503_error.yml +0 -14
- data/spec/fixtures/slack/web/channels_info.yml +0 -46
- data/spec/fixtures/slack/web/groups_info.yml +0 -43
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
- data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
|
|
4
4
|
desc 'Conversations methods.'
|
|
5
5
|
command 'conversations' do |g|
|
|
6
|
+
g.desc 'Accepts an invitation to a Slack Connect channel.'
|
|
7
|
+
g.long_desc %( Accepts an invitation to a Slack Connect channel. )
|
|
8
|
+
g.command 'acceptSharedInvite' do |c|
|
|
9
|
+
c.flag 'channel_name', desc: 'Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take.'
|
|
10
|
+
c.flag 'channel_id', desc: "ID of the channel that you'd like to accept. Must provide either invite_id or channel_id."
|
|
11
|
+
c.flag 'free_trial_accepted', desc: "Whether you'd like to use your workspace's free trial to begin using Slack Connect."
|
|
12
|
+
c.flag 'invite_id', desc: 'See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.'
|
|
13
|
+
c.flag 'is_private', desc: 'Whether the channel should be private.'
|
|
14
|
+
c.flag 'team_id', desc: 'The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the team_id argument is required.'
|
|
15
|
+
c.action do |_global_options, options, _args|
|
|
16
|
+
puts JSON.dump($client.conversations_acceptSharedInvite(options))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
g.desc 'Approves an invitation to a Slack Connect channel'
|
|
21
|
+
g.long_desc %( Approves an invitation to a Slack Connect channel )
|
|
22
|
+
g.command 'approveSharedInvite' do |c|
|
|
23
|
+
c.flag 'invite_id', desc: 'ID of the shared channel invite to approve.'
|
|
24
|
+
c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are approving.'
|
|
25
|
+
c.action do |_global_options, options, _args|
|
|
26
|
+
puts JSON.dump($client.conversations_approveSharedInvite(options))
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
6
30
|
g.desc 'Archives a conversation.'
|
|
7
31
|
g.long_desc %( Archives a conversation. )
|
|
8
32
|
g.command 'archive' do |c|
|
|
@@ -26,19 +50,29 @@ command 'conversations' do |g|
|
|
|
26
50
|
g.command 'create' do |c|
|
|
27
51
|
c.flag 'name', desc: 'Name of the public or private channel to create.'
|
|
28
52
|
c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
|
|
29
|
-
c.flag '
|
|
53
|
+
c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
|
|
30
54
|
c.action do |_global_options, options, _args|
|
|
31
55
|
puts JSON.dump($client.conversations_create(options))
|
|
32
56
|
end
|
|
33
57
|
end
|
|
34
58
|
|
|
59
|
+
g.desc 'Declines a Slack Connect channel invite.'
|
|
60
|
+
g.long_desc %( Declines a Slack Connect channel invite. )
|
|
61
|
+
g.command 'declineSharedInvite' do |c|
|
|
62
|
+
c.flag 'invite_id', desc: 'ID of the Slack Connect invite to decline. Subscribe to the shared_channel_invite_accepted event to receive IDs of Slack Connect channel invites that have been accepted and are awaiting approval.'
|
|
63
|
+
c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are declining.'
|
|
64
|
+
c.action do |_global_options, options, _args|
|
|
65
|
+
puts JSON.dump($client.conversations_declineSharedInvite(options))
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
35
69
|
g.desc "Fetches a conversation's history of messages and events."
|
|
36
70
|
g.long_desc %( Fetches a conversation's history of messages and events. )
|
|
37
71
|
g.command 'history' do |c|
|
|
38
72
|
c.flag 'channel', desc: 'Conversation ID to fetch history for.'
|
|
39
73
|
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."
|
|
40
74
|
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results only when either timestamp is specified.'
|
|
41
|
-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
|
75
|
+
c.flag 'latest', desc: 'End of time range of messages to include in results. Default is the current time.'
|
|
42
76
|
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."
|
|
43
77
|
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
|
44
78
|
c.action do |_global_options, options, _args|
|
|
@@ -67,6 +101,18 @@ command 'conversations' do |g|
|
|
|
67
101
|
end
|
|
68
102
|
end
|
|
69
103
|
|
|
104
|
+
g.desc 'Sends an invitation to a Slack Connect channel'
|
|
105
|
+
g.long_desc %( Sends an invitation to a Slack Connect channel )
|
|
106
|
+
g.command 'inviteShared' do |c|
|
|
107
|
+
c.flag 'channel', desc: "ID of the channel on your team that you'd like to share."
|
|
108
|
+
c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided.'
|
|
109
|
+
c.flag 'external_limited', desc: 'Optional boolean on whether invite is to a external limited member. Defaults to true.'
|
|
110
|
+
c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided.'
|
|
111
|
+
c.action do |_global_options, options, _args|
|
|
112
|
+
puts JSON.dump($client.conversations_inviteShared(options))
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
70
116
|
g.desc 'Joins an existing conversation.'
|
|
71
117
|
g.long_desc %( Joins an existing conversation. )
|
|
72
118
|
g.command 'join' do |c|
|
|
@@ -101,12 +147,33 @@ command 'conversations' do |g|
|
|
|
101
147
|
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."
|
|
102
148
|
c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
|
|
103
149
|
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
|
|
150
|
+
c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.'
|
|
104
151
|
c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
|
|
105
152
|
c.action do |_global_options, options, _args|
|
|
106
153
|
puts JSON.dump($client.conversations_list(options))
|
|
107
154
|
end
|
|
108
155
|
end
|
|
109
156
|
|
|
157
|
+
g.desc 'Lists shared channel invites that have been generated or received but have not been approved by all parties'
|
|
158
|
+
g.long_desc %( Lists shared channel invites that have been generated or received but have not been approved by all parties )
|
|
159
|
+
g.command 'listConnectInvites' do |c|
|
|
160
|
+
c.flag 'cursor', desc: 'Set to next_cursor returned by previous call to list items in subsequent page.'
|
|
161
|
+
c.flag 'team_id', desc: 'Encoded team id for the workspace to retrieve invites for, required if org token is used.'
|
|
162
|
+
c.action do |_global_options, options, _args|
|
|
163
|
+
puts JSON.dump($client.conversations_listConnectInvites(options))
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
g.desc 'Sets the read cursor in a channel.'
|
|
168
|
+
g.long_desc %( Sets the read cursor in a channel. )
|
|
169
|
+
g.command 'mark' do |c|
|
|
170
|
+
c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
|
|
171
|
+
c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
|
|
172
|
+
c.action do |_global_options, options, _args|
|
|
173
|
+
puts JSON.dump($client.conversations_mark(options))
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
110
177
|
g.desc 'Retrieve members of a conversation.'
|
|
111
178
|
g.long_desc %( Retrieve members of a conversation. )
|
|
112
179
|
g.command 'members' do |c|
|
|
@@ -122,6 +189,7 @@ command 'conversations' do |g|
|
|
|
122
189
|
g.long_desc %( Opens or resumes a direct message or multi-person direct message. )
|
|
123
190
|
g.command 'open' do |c|
|
|
124
191
|
c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead."
|
|
192
|
+
c.flag 'prevent_creation', desc: 'Do not create a direct message or multi-person direct message. This is used to see if there is an existing dm or mpdm.'
|
|
125
193
|
c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
|
|
126
194
|
c.flag 'users', desc: 'Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.'
|
|
127
195
|
c.action do |_global_options, options, _args|
|
|
@@ -143,7 +211,7 @@ command 'conversations' do |g|
|
|
|
143
211
|
g.long_desc %( Retrieve a thread of messages posted to a conversation )
|
|
144
212
|
g.command 'replies' do |c|
|
|
145
213
|
c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
|
|
146
|
-
c.flag 'ts', desc: "Unique identifier of a thread's parent message."
|
|
214
|
+
c.flag 'ts', desc: "Unique identifier of either a thread's parent message or a message in the thread. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message."
|
|
147
215
|
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."
|
|
148
216
|
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results only when either timestamp is specified.'
|
|
149
217
|
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
data/bin/commands/dnd.rb
CHANGED
|
@@ -22,6 +22,7 @@ command 'dnd' do |g|
|
|
|
22
22
|
g.desc "Retrieves a user's current Do Not Disturb status."
|
|
23
23
|
g.long_desc %( Retrieves a user's current Do Not Disturb status. )
|
|
24
24
|
g.command 'info' do |c|
|
|
25
|
+
c.flag 'team_id', desc: 'Encoded team id where passed in user param belongs, required if org token is used. If no user param is passed, then a team which has access to the app should be passed.'
|
|
25
26
|
c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
|
|
26
27
|
c.action do |_global_options, options, _args|
|
|
27
28
|
puts JSON.dump($client.dnd_info(options))
|
|
@@ -41,6 +42,7 @@ command 'dnd' do |g|
|
|
|
41
42
|
g.long_desc %( Retrieves the Do Not Disturb status for up to 50 users on a team. )
|
|
42
43
|
g.command 'teamInfo' do |c|
|
|
43
44
|
c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
|
|
45
|
+
c.flag 'team_id', desc: 'Encoded team id where passed in users belong, required if org token is used.'
|
|
44
46
|
c.action do |_global_options, options, _args|
|
|
45
47
|
puts JSON.dump($client.dnd_teamInfo(options))
|
|
46
48
|
end
|
data/bin/commands/files.rb
CHANGED
|
@@ -23,8 +23,8 @@ command 'files' do |g|
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
g.desc 'Gets information about a
|
|
27
|
-
g.long_desc %( Gets information about a
|
|
26
|
+
g.desc 'Gets information about a file.'
|
|
27
|
+
g.long_desc %( Gets information about a file. )
|
|
28
28
|
g.command 'info' do |c|
|
|
29
29
|
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
|
30
30
|
c.flag 'cursor', desc: "Parameter for pagination. File comments are paginated for a single file. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection of comments. See pagination for more details."
|
|
@@ -34,11 +34,13 @@ command 'files' do |g|
|
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
g.desc '
|
|
38
|
-
g.long_desc %(
|
|
37
|
+
g.desc 'List for a team, in a channel, or from a user with applied filters.'
|
|
38
|
+
g.long_desc %( List for a team, in a channel, or from a user with applied filters. )
|
|
39
39
|
g.command 'list' do |c|
|
|
40
40
|
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
|
|
41
|
+
c.flag 'files', desc: '.'
|
|
41
42
|
c.flag 'show_files_hidden_by_limit', desc: 'Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.'
|
|
43
|
+
c.flag 'team_id', desc: 'encoded team id to list files in, required if org token is used.'
|
|
42
44
|
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
|
|
43
45
|
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
|
|
44
46
|
c.flag 'types', desc: 'Filter files by type (see below). You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.'
|
|
@@ -54,8 +54,8 @@ command 'files_remote' do |g|
|
|
|
54
54
|
g.long_desc %( Share a remote file into a channel. )
|
|
55
55
|
g.command 'share' do |c|
|
|
56
56
|
c.flag 'channels', desc: 'Comma-separated list of channel IDs where the file will be shared.'
|
|
57
|
-
c.flag 'external_id', desc: '
|
|
58
|
-
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
|
57
|
+
c.flag 'external_id', desc: 'The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or file or both are required.'
|
|
58
|
+
c.flag 'file', desc: 'Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.'
|
|
59
59
|
c.action do |_global_options, options, _args|
|
|
60
60
|
puts JSON.dump($client.files_remote_share(options))
|
|
61
61
|
end
|
data/bin/commands/groups.rb
CHANGED
|
@@ -1,49 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
desc '
|
|
4
|
+
desc "Get info on your team's private channels."
|
|
5
5
|
command 'groups' do |g|
|
|
6
|
-
g.desc 'Archives a private channel.'
|
|
7
|
-
g.long_desc %( Archives a private channel. )
|
|
8
|
-
g.command 'archive' do |c|
|
|
9
|
-
c.flag 'channel', desc: 'Private channel to archive.'
|
|
10
|
-
c.action do |_global_options, options, _args|
|
|
11
|
-
puts JSON.dump($client.groups_archive(options))
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
g.desc 'Creates a private channel.'
|
|
16
|
-
g.long_desc %( Creates a private channel. )
|
|
17
|
-
g.command 'create' do |c|
|
|
18
|
-
c.flag 'name', desc: 'Name of private channel to create.'
|
|
19
|
-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
|
20
|
-
c.action do |_global_options, options, _args|
|
|
21
|
-
puts JSON.dump($client.groups_create(options))
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
g.desc 'Clones and archives a private channel.'
|
|
26
|
-
g.long_desc %( Clones and archives a private channel. )
|
|
27
|
-
g.command 'createChild' do |c|
|
|
28
|
-
c.flag 'channel', desc: 'Private channel to clone and archive.'
|
|
29
|
-
c.action do |_global_options, options, _args|
|
|
30
|
-
puts JSON.dump($client.groups_createChild(options))
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
g.desc 'Fetches history of messages and events from a private channel.'
|
|
35
|
-
g.long_desc %( Fetches history of messages and events from a private channel. )
|
|
36
|
-
g.command 'history' do |c|
|
|
37
|
-
c.flag 'channel', desc: 'Private channel to fetch history for.'
|
|
38
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
|
39
|
-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
|
40
|
-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
|
41
|
-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
|
42
|
-
c.action do |_global_options, options, _args|
|
|
43
|
-
puts JSON.dump($client.groups_history(options))
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
6
|
g.desc 'This method returns the ID of a group.'
|
|
48
7
|
g.long_desc %( This method returns the ID of a group. )
|
|
49
8
|
g.command 'id' do |c|
|
|
@@ -52,124 +11,4 @@ command 'groups' do |g|
|
|
|
52
11
|
puts JSON.dump($client.groups_id(options))
|
|
53
12
|
end
|
|
54
13
|
end
|
|
55
|
-
|
|
56
|
-
g.desc 'Gets information about a private channel.'
|
|
57
|
-
g.long_desc %( Gets information about a private channel. )
|
|
58
|
-
g.command 'info' do |c|
|
|
59
|
-
c.flag 'channel', desc: 'Private channel to get info on.'
|
|
60
|
-
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this group. Defaults to false.'
|
|
61
|
-
c.action do |_global_options, options, _args|
|
|
62
|
-
puts JSON.dump($client.groups_info(options))
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
g.desc 'Invites a user to a private channel.'
|
|
67
|
-
g.long_desc %( Invites a user to a private channel. )
|
|
68
|
-
g.command 'invite' do |c|
|
|
69
|
-
c.flag 'channel', desc: 'Private channel to invite user to.'
|
|
70
|
-
c.flag 'user', desc: 'User to invite.'
|
|
71
|
-
c.action do |_global_options, options, _args|
|
|
72
|
-
puts JSON.dump($client.groups_invite(options))
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
g.desc 'Removes a user from a private channel.'
|
|
77
|
-
g.long_desc %( Removes a user from a private channel. )
|
|
78
|
-
g.command 'kick' do |c|
|
|
79
|
-
c.flag 'channel', desc: 'Private channel to remove user from.'
|
|
80
|
-
c.flag 'user', desc: 'User to remove from private channel.'
|
|
81
|
-
c.action do |_global_options, options, _args|
|
|
82
|
-
puts JSON.dump($client.groups_kick(options))
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
g.desc 'Leaves a private channel.'
|
|
87
|
-
g.long_desc %( Leaves a private channel. )
|
|
88
|
-
g.command 'leave' do |c|
|
|
89
|
-
c.flag 'channel', desc: 'Private channel to leave.'
|
|
90
|
-
c.action do |_global_options, options, _args|
|
|
91
|
-
puts JSON.dump($client.groups_leave(options))
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
g.desc 'Lists private channels that the calling user has access to.'
|
|
96
|
-
g.long_desc %( Lists private channels that the calling user has access to. )
|
|
97
|
-
g.command 'list' do |c|
|
|
98
|
-
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
|
|
99
|
-
c.flag 'exclude_archived', desc: "Don't return archived private channels."
|
|
100
|
-
c.flag 'exclude_members', desc: 'Exclude the members from each group.'
|
|
101
|
-
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
|
|
102
|
-
c.action do |_global_options, options, _args|
|
|
103
|
-
puts JSON.dump($client.groups_list(options))
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
g.desc 'Sets the read cursor in a private channel.'
|
|
108
|
-
g.long_desc %( Sets the read cursor in a private channel. )
|
|
109
|
-
g.command 'mark' do |c|
|
|
110
|
-
c.flag 'channel', desc: 'Private channel to set reading cursor in.'
|
|
111
|
-
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
|
112
|
-
c.action do |_global_options, options, _args|
|
|
113
|
-
puts JSON.dump($client.groups_mark(options))
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
g.desc 'Opens a private channel.'
|
|
118
|
-
g.long_desc %( Opens a private channel. )
|
|
119
|
-
g.command 'open' do |c|
|
|
120
|
-
c.flag 'channel', desc: 'Private channel to open.'
|
|
121
|
-
c.action do |_global_options, options, _args|
|
|
122
|
-
puts JSON.dump($client.groups_open(options))
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
g.desc 'Renames a private channel.'
|
|
127
|
-
g.long_desc %( Renames a private channel. )
|
|
128
|
-
g.command 'rename' do |c|
|
|
129
|
-
c.flag 'channel', desc: 'Private channel to rename.'
|
|
130
|
-
c.flag 'name', desc: 'New name for private channel.'
|
|
131
|
-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
|
132
|
-
c.action do |_global_options, options, _args|
|
|
133
|
-
puts JSON.dump($client.groups_rename(options))
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
g.desc 'Retrieve a thread of messages posted to a private channel'
|
|
138
|
-
g.long_desc %( Retrieve a thread of messages posted to a private channel )
|
|
139
|
-
g.command 'replies' do |c|
|
|
140
|
-
c.flag 'channel', desc: 'Private channel to fetch thread from.'
|
|
141
|
-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
|
142
|
-
c.action do |_global_options, options, _args|
|
|
143
|
-
puts JSON.dump($client.groups_replies(options))
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
g.desc 'Sets the purpose for a private channel.'
|
|
148
|
-
g.long_desc %( Sets the purpose for a private channel. )
|
|
149
|
-
g.command 'setPurpose' do |c|
|
|
150
|
-
c.flag 'channel', desc: 'Private channel to set the purpose of.'
|
|
151
|
-
c.flag 'purpose', desc: 'The new purpose.'
|
|
152
|
-
c.action do |_global_options, options, _args|
|
|
153
|
-
puts JSON.dump($client.groups_setPurpose(options))
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
g.desc 'Sets the topic for a private channel.'
|
|
158
|
-
g.long_desc %( Sets the topic for a private channel. )
|
|
159
|
-
g.command 'setTopic' do |c|
|
|
160
|
-
c.flag 'channel', desc: 'Private channel to set the topic of.'
|
|
161
|
-
c.flag 'topic', desc: 'The new topic.'
|
|
162
|
-
c.action do |_global_options, options, _args|
|
|
163
|
-
puts JSON.dump($client.groups_setTopic(options))
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
g.desc 'Unarchives a private channel.'
|
|
168
|
-
g.long_desc %( Unarchives a private channel. )
|
|
169
|
-
g.command 'unarchive' do |c|
|
|
170
|
-
c.flag 'channel', desc: 'Private channel to unarchive.'
|
|
171
|
-
c.action do |_global_options, options, _args|
|
|
172
|
-
puts JSON.dump($client.groups_unarchive(options))
|
|
173
|
-
end
|
|
174
|
-
end
|
|
175
14
|
end
|
data/bin/commands/im.rb
CHANGED
|
@@ -1,68 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
desc '
|
|
4
|
+
desc 'Get info on your direct messages.'
|
|
5
5
|
command 'im' do |g|
|
|
6
|
-
g.desc 'Close a direct message channel.'
|
|
7
|
-
g.long_desc %( Close a direct message channel. )
|
|
8
|
-
g.command 'close' do |c|
|
|
9
|
-
c.flag 'channel', desc: 'Direct message channel to close.'
|
|
10
|
-
c.action do |_global_options, options, _args|
|
|
11
|
-
puts JSON.dump($client.im_close(options))
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
g.desc 'Fetches history of messages and events from direct message channel.'
|
|
16
|
-
g.long_desc %( Fetches history of messages and events from direct message channel. )
|
|
17
|
-
g.command 'history' do |c|
|
|
18
|
-
c.flag 'channel', desc: 'Direct message channel to fetch history for.'
|
|
19
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
|
20
|
-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
|
21
|
-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
|
22
|
-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
|
23
|
-
c.action do |_global_options, options, _args|
|
|
24
|
-
puts JSON.dump($client.im_history(options))
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
g.desc 'Lists direct message channels for the calling user.'
|
|
29
|
-
g.long_desc %( Lists direct message channels for the calling user. )
|
|
30
|
-
g.command 'list' do |c|
|
|
31
|
-
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."
|
|
32
|
-
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."
|
|
33
|
-
c.action do |_global_options, options, _args|
|
|
34
|
-
puts JSON.dump($client.im_list(options))
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
g.desc 'Sets the read cursor in a direct message channel.'
|
|
39
|
-
g.long_desc %( Sets the read cursor in a direct message channel. )
|
|
40
|
-
g.command 'mark' do |c|
|
|
41
|
-
c.flag 'channel', desc: 'Direct message channel to set reading cursor in.'
|
|
42
|
-
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
|
43
|
-
c.action do |_global_options, options, _args|
|
|
44
|
-
puts JSON.dump($client.im_mark(options))
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
g.desc 'Opens a direct message channel.'
|
|
49
|
-
g.long_desc %( Opens a direct message channel. )
|
|
50
|
-
g.command 'open' do |c|
|
|
51
|
-
c.flag 'user', desc: 'User to open a direct message channel with.'
|
|
52
|
-
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this im. Defaults to false.'
|
|
53
|
-
c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
|
|
54
|
-
c.action do |_global_options, options, _args|
|
|
55
|
-
puts JSON.dump($client.im_open(options))
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
g.desc 'Retrieve a thread of messages posted to a direct message conversation'
|
|
60
|
-
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation )
|
|
61
|
-
g.command 'replies' do |c|
|
|
62
|
-
c.flag 'channel', desc: 'Direct message channel to fetch thread from.'
|
|
63
|
-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
|
64
|
-
c.action do |_global_options, options, _args|
|
|
65
|
-
puts JSON.dump($client.im_replies(options))
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
6
|
end
|
data/bin/commands/migration.rb
CHANGED
|
@@ -7,6 +7,7 @@ command 'migration' do |g|
|
|
|
7
7
|
g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs )
|
|
8
8
|
g.command 'exchange' do |c|
|
|
9
9
|
c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.'
|
|
10
|
+
c.flag 'team_id', desc: 'Specify team_id starts with T in case of Org Token.'
|
|
10
11
|
c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.'
|
|
11
12
|
c.action do |_global_options, options, _args|
|
|
12
13
|
puts JSON.dump($client.migration_exchange(options))
|
data/bin/commands/mpim.rb
CHANGED
|
@@ -1,66 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
desc '
|
|
4
|
+
desc 'Get info on your multiparty direct messages.'
|
|
5
5
|
command 'mpim' do |g|
|
|
6
|
-
g.desc 'Closes a multiparty direct message channel.'
|
|
7
|
-
g.long_desc %( Closes a multiparty direct message channel. )
|
|
8
|
-
g.command 'close' do |c|
|
|
9
|
-
c.flag 'channel', desc: 'MPIM to close.'
|
|
10
|
-
c.action do |_global_options, options, _args|
|
|
11
|
-
puts JSON.dump($client.mpim_close(options))
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
g.desc 'Fetches history of messages and events from a multiparty direct message.'
|
|
16
|
-
g.long_desc %( Fetches history of messages and events from a multiparty direct message. )
|
|
17
|
-
g.command 'history' do |c|
|
|
18
|
-
c.flag 'channel', desc: 'Multiparty direct message to fetch history for.'
|
|
19
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
|
20
|
-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
|
21
|
-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
|
22
|
-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
|
23
|
-
c.action do |_global_options, options, _args|
|
|
24
|
-
puts JSON.dump($client.mpim_history(options))
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
g.desc 'Lists multiparty direct message channels for the calling user.'
|
|
29
|
-
g.long_desc %( Lists multiparty direct message channels for the calling user. )
|
|
30
|
-
g.command 'list' do |c|
|
|
31
|
-
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
|
|
32
|
-
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
|
|
33
|
-
c.action do |_global_options, options, _args|
|
|
34
|
-
puts JSON.dump($client.mpim_list(options))
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
g.desc 'Sets the read cursor in a multiparty direct message channel.'
|
|
39
|
-
g.long_desc %( Sets the read cursor in a multiparty direct message channel. )
|
|
40
|
-
g.command 'mark' do |c|
|
|
41
|
-
c.flag 'channel', desc: 'multiparty direct message channel to set reading cursor in.'
|
|
42
|
-
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
|
43
|
-
c.action do |_global_options, options, _args|
|
|
44
|
-
puts JSON.dump($client.mpim_mark(options))
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
g.desc 'This method opens a multiparty direct message.'
|
|
49
|
-
g.long_desc %( This method opens a multiparty direct message. )
|
|
50
|
-
g.command 'open' do |c|
|
|
51
|
-
c.flag 'users', desc: 'Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.'
|
|
52
|
-
c.action do |_global_options, options, _args|
|
|
53
|
-
puts JSON.dump($client.mpim_open(options))
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
g.desc 'Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.'
|
|
58
|
-
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message. )
|
|
59
|
-
g.command 'replies' do |c|
|
|
60
|
-
c.flag 'channel', desc: 'Multiparty direct message channel to fetch thread from.'
|
|
61
|
-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
|
62
|
-
c.action do |_global_options, options, _args|
|
|
63
|
-
puts JSON.dump($client.mpim_replies(options))
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
6
|
end
|
data/bin/commands/oauth.rb
CHANGED
|
@@ -15,17 +15,4 @@ command 'oauth' do |g|
|
|
|
15
15
|
puts JSON.dump($client.oauth_access(options))
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
|
-
|
|
19
|
-
g.desc 'Exchanges a temporary OAuth verifier code for a workspace token.'
|
|
20
|
-
g.long_desc %( Exchanges a temporary OAuth verifier code for a workspace token. )
|
|
21
|
-
g.command 'token' do |c|
|
|
22
|
-
c.flag 'client_id', desc: 'Issued when you created your application.'
|
|
23
|
-
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
|
24
|
-
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
|
25
|
-
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
|
26
|
-
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel.'
|
|
27
|
-
c.action do |_global_options, options, _args|
|
|
28
|
-
puts JSON.dump($client.oauth_token(options))
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
18
|
end
|
data/bin/commands/oauth_v2.rb
CHANGED
|
@@ -6,12 +6,24 @@ command 'oauth_v2' do |g|
|
|
|
6
6
|
g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
|
|
7
7
|
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
|
|
8
8
|
g.command 'access' do |c|
|
|
9
|
-
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
|
10
9
|
c.flag 'client_id', desc: 'Issued when you created your application.'
|
|
11
10
|
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
|
11
|
+
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
|
12
|
+
c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
|
|
12
13
|
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
|
14
|
+
c.flag 'refresh_token', desc: 'The refresh_token param as described in the OAuth spec.'
|
|
13
15
|
c.action do |_global_options, options, _args|
|
|
14
16
|
puts JSON.dump($client.oauth_v2_access(options))
|
|
15
17
|
end
|
|
16
18
|
end
|
|
19
|
+
|
|
20
|
+
g.desc 'Exchanges a legacy access token for a new expiring access token and refresh token'
|
|
21
|
+
g.long_desc %( Exchanges a legacy access token for a new expiring access token and refresh token )
|
|
22
|
+
g.command 'exchange' do |c|
|
|
23
|
+
c.flag 'client_id', desc: 'Issued when you created your application.'
|
|
24
|
+
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
|
25
|
+
c.action do |_global_options, options, _args|
|
|
26
|
+
puts JSON.dump($client.oauth_v2_exchange(options))
|
|
27
|
+
end
|
|
28
|
+
end
|
|
17
29
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
|
3
|
+
|
|
4
|
+
desc 'OpenidConnect methods.'
|
|
5
|
+
command 'openid_connect' do |g|
|
|
6
|
+
g.desc 'Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack.'
|
|
7
|
+
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. )
|
|
8
|
+
g.command 'token' do |c|
|
|
9
|
+
c.flag 'client_id', desc: 'Issued when you created your application.'
|
|
10
|
+
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
|
11
|
+
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
|
12
|
+
c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
|
|
13
|
+
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
|
14
|
+
c.flag 'refresh_token', desc: 'The refresh_token param as described in the OAuth spec.'
|
|
15
|
+
c.action do |_global_options, options, _args|
|
|
16
|
+
puts JSON.dump($client.openid_connect_token(options))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
g.desc 'Get the identity of a user who has authorized Sign in with Slack.'
|
|
21
|
+
g.long_desc %( Get the identity of a user who has authorized Sign in with Slack. )
|
|
22
|
+
g.command 'userInfo' do |c|
|
|
23
|
+
c.action do |_global_options, options, _args|
|
|
24
|
+
puts JSON.dump($client.openid_connect_userInfo(options))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
data/bin/commands/pins.rb
CHANGED
|
@@ -6,8 +6,8 @@ command 'pins' do |g|
|
|
|
6
6
|
g.desc 'Pins an item to a channel.'
|
|
7
7
|
g.long_desc %( Pins an item to a channel. )
|
|
8
8
|
g.command 'add' do |c|
|
|
9
|
-
c.flag 'channel', desc: 'Channel to pin the
|
|
10
|
-
c.flag 'timestamp', desc: 'Timestamp of the message to pin.'
|
|
9
|
+
c.flag 'channel', desc: 'Channel to pin the messsage to. You must also include a timestamp when pinning messages.'
|
|
10
|
+
c.flag 'timestamp', desc: 'Timestamp of the message to pin. You must also include the channel.'
|
|
11
11
|
c.action do |_global_options, options, _args|
|
|
12
12
|
puts JSON.dump($client.pins_add(options))
|
|
13
13
|
end
|
|
@@ -26,8 +26,6 @@ command 'pins' do |g|
|
|
|
26
26
|
g.long_desc %( Un-pins an item from a channel. )
|
|
27
27
|
g.command 'remove' do |c|
|
|
28
28
|
c.flag 'channel', desc: 'Channel where the item is pinned to.'
|
|
29
|
-
c.flag 'file', desc: 'File to un-pin.'
|
|
30
|
-
c.flag 'file_comment', desc: 'File comment to un-pin.'
|
|
31
29
|
c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.'
|
|
32
30
|
c.action do |_global_options, options, _args|
|
|
33
31
|
puts JSON.dump($client.pins_remove(options))
|
data/bin/commands/reactions.rb
CHANGED
|
@@ -33,6 +33,7 @@ command 'reactions' do |g|
|
|
|
33
33
|
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
|
|
34
34
|
c.flag 'full', desc: 'If true always return the complete reaction list.'
|
|
35
35
|
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
|
|
36
|
+
c.flag 'team_id', desc: 'encoded team id to list reactions in, required if org token is used.'
|
|
36
37
|
c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
|
|
37
38
|
c.action do |_global_options, options, _args|
|
|
38
39
|
puts JSON.dump($client.reactions_list(options))
|