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
|
@@ -5,20 +5,18 @@ module Slack
|
|
|
5
5
|
module Web
|
|
6
6
|
module Api
|
|
7
7
|
module Mixins
|
|
8
|
-
module
|
|
8
|
+
module Conversations
|
|
9
9
|
include Ids
|
|
10
10
|
#
|
|
11
11
|
# This method returns a channel ID given a channel name.
|
|
12
12
|
#
|
|
13
13
|
# @option options [channel] :channel
|
|
14
14
|
# Channel to get ID for, prefixed with #.
|
|
15
|
-
def
|
|
15
|
+
def conversations_id(options = {})
|
|
16
16
|
name = options[:channel]
|
|
17
17
|
throw ArgumentError.new('Required arguments :channel missing') if name.nil?
|
|
18
18
|
|
|
19
|
-
id_for
|
|
20
|
-
channels_list
|
|
21
|
-
end
|
|
19
|
+
id_for :channel, name, '#', :conversations_list, :channels, 'channel_not_found'
|
|
22
20
|
end
|
|
23
21
|
end
|
|
24
22
|
end
|
|
@@ -6,14 +6,12 @@ module Slack
|
|
|
6
6
|
module Ids
|
|
7
7
|
private
|
|
8
8
|
|
|
9
|
-
def id_for(key, name, prefix, list_method, not_found_error)
|
|
9
|
+
def id_for(key, name, prefix, enum_method, list_method, not_found_error)
|
|
10
10
|
return { 'ok' => true, key.to_s => { 'id' => name } } unless name[0] == prefix
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
public_send enum_method do |list|
|
|
13
13
|
list.public_send(list_method).each do |li|
|
|
14
|
-
if li.name == name[1..-1]
|
|
15
|
-
return Slack::Messages::Message.new('ok' => true, key.to_s => { 'id' => li.id })
|
|
16
|
-
end
|
|
14
|
+
return Slack::Messages::Message.new('ok' => true, key.to_s => { 'id' => li.id }) if li.name == name[1..-1]
|
|
17
15
|
end
|
|
18
16
|
end
|
|
19
17
|
|
|
@@ -16,9 +16,7 @@ module Slack
|
|
|
16
16
|
name = options[:user]
|
|
17
17
|
throw ArgumentError.new('Required arguments :user missing') if name.nil?
|
|
18
18
|
|
|
19
|
-
id_for
|
|
20
|
-
users_list
|
|
21
|
-
end
|
|
19
|
+
id_for :user, name, '@', :users_list, :members, 'user_not_found'
|
|
22
20
|
end
|
|
23
21
|
end
|
|
24
22
|
end
|
data/lib/slack/web/api/mixins.rb
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb
|
|
2
|
-
index
|
|
2
|
+
index d090ae2..50186d5 100644
|
|
3
3
|
--- a/lib/slack/web/api/endpoints/chat.rb
|
|
4
4
|
+++ b/lib/slack/web/api/endpoints/chat.rb
|
|
5
|
-
@@ -
|
|
5
|
+
@@ -121,10 +121,22 @@ module Slack
|
|
6
|
+
# @see https://api.slack.com/methods/chat.postEphemeral
|
|
6
7
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
|
|
7
8
|
def chat_postEphemeral(options = {})
|
|
8
9
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
|
9
|
-
- throw ArgumentError.new('Required arguments :text
|
|
10
|
+
- throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
|
|
10
11
|
+ throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
|
|
11
12
|
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
|
12
13
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
+ # attachments must be passed as an encoded JSON string
|
|
15
|
+
+ if options.key?(:attachments)
|
|
16
|
+
+ attachments = options[:attachments]
|
|
17
|
+
+ attachments = JSON.dump(attachments) unless attachments.is_a?(String)
|
|
18
|
+
+ options = options.merge(attachments: attachments)
|
|
19
|
+
+ end
|
|
18
20
|
+ # blocks must be passed as an encoded JSON string
|
|
19
21
|
+ if options.key?(:blocks)
|
|
20
22
|
+ blocks = options[:blocks]
|
|
@@ -24,18 +26,17 @@ index 54a7db1..c535bb5 100644
|
|
|
24
26
|
post('chat.postEphemeral', options)
|
|
25
27
|
end
|
|
26
28
|
|
|
27
|
-
@@ -
|
|
29
|
+
@@ -168,6 +179,19 @@ module Slack
|
|
28
30
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
|
|
29
31
|
def chat_postMessage(options = {})
|
|
30
32
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
|
31
|
-
- throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil?
|
|
32
33
|
+ throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
+ # attachments must be passed as an encoded JSON string
|
|
35
|
+
+ if options.key?(:attachments)
|
|
36
|
+
+ attachments = options[:attachments]
|
|
37
|
+
+ attachments = JSON.dump(attachments) unless attachments.is_a?(String)
|
|
38
|
+
+ options = options.merge(attachments: attachments)
|
|
39
|
+
+ end
|
|
39
40
|
+ # blocks must be passed as an encoded JSON string
|
|
40
41
|
+ if options.key?(:blocks)
|
|
41
42
|
+ blocks = options[:blocks]
|
|
@@ -45,19 +46,19 @@ index 54a7db1..c535bb5 100644
|
|
|
45
46
|
post('chat.postMessage', options)
|
|
46
47
|
end
|
|
47
48
|
|
|
48
|
-
@@ -
|
|
49
|
+
@@ -257,8 +281,21 @@ module Slack
|
|
49
50
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
|
|
50
51
|
def chat_update(options = {})
|
|
51
52
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
|
52
|
-
- throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil?
|
|
53
53
|
+ throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
|
|
54
54
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
|
55
|
-
options = options.merge(channel:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
|
56
|
+
+ # attachments must be passed as an encoded JSON string
|
|
57
|
+
+ if options.key?(:attachments)
|
|
58
|
+
+ attachments = options[:attachments]
|
|
59
|
+
+ attachments = JSON.dump(attachments) unless attachments.is_a?(String)
|
|
60
|
+
+ options = options.merge(attachments: attachments)
|
|
61
|
+
+ end
|
|
61
62
|
+ # blocks must be passed as an encoded JSON string
|
|
62
63
|
+ if options.key?(:blocks)
|
|
63
64
|
+ blocks = options[:blocks]
|
|
@@ -9,9 +9,8 @@ module Slack
|
|
|
9
9
|
module Web
|
|
10
10
|
module Api
|
|
11
11
|
module Endpoints
|
|
12
|
-
include Slack::Web::Api::Mixins::
|
|
12
|
+
include Slack::Web::Api::Mixins::Conversations
|
|
13
13
|
include Slack::Web::Api::Mixins::Users
|
|
14
|
-
include Slack::Web::Api::Mixins::Groups
|
|
15
14
|
|
|
16
15
|
<% files.sort.each do |f| %>
|
|
17
16
|
include <%= f.camelize %>
|
|
@@ -40,7 +40,7 @@ module Slack
|
|
|
40
40
|
<% if data['group'] == 'groups' && data['args']['channel'] && !data['args']['channel']['desc'].include?('Can be an encoded ID, or a name.') %>
|
|
41
41
|
options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
|
|
42
42
|
<% elsif data['args']['channel'] && !data['args']['channel']['desc'].include?('Can be an encoded ID, or a name.') %>
|
|
43
|
-
options = options.merge(channel:
|
|
43
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
|
44
44
|
<% end %>
|
|
45
45
|
<% if data['args']['user'] %>
|
|
46
46
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
@@ -48,6 +48,9 @@ module Slack
|
|
|
48
48
|
<% if data['undocumented'] %>
|
|
49
49
|
logger.warn('The <%= group %>.<%= name %> method is undocumented.')
|
|
50
50
|
<% end %>
|
|
51
|
+
<% if data['deprecated'] %>
|
|
52
|
+
logger.warn('<%= group %>.<%= name %>: <%= data['deprecation']['deprecation_warning']%> Alternative methods: <%= data['deprecation']['alternative_methods'].join(', ')%>.')
|
|
53
|
+
<% end %>
|
|
51
54
|
<% if data['args'].keys.include?('cursor') %>
|
|
52
55
|
if block_given?
|
|
53
56
|
Pagination::Cursor.new(self, :<%= group.gsub(".", "_") %>_<%= name %>, options).each do |page|
|
|
@@ -12,7 +12,7 @@ RSpec.describe Slack::Web::Api::Endpoints::<%= group.gsub(".", "_").camelize %>
|
|
|
12
12
|
context '<%= group %>_<%= name %>' do
|
|
13
13
|
<% required_params.each do |arg_name, arg_v| %>
|
|
14
14
|
it 'requires <%= arg_name %>' do
|
|
15
|
-
<% params_except_required = required_params.reject{ |name, _| name == arg_name }.map{|var, opts| "#{var}:
|
|
15
|
+
<% params_except_required = required_params.reject{ |name, _| name == arg_name }.map{ |var, opts| "#{var}: %q[#{opts['example']}]"}.join(', ') %>
|
|
16
16
|
expect { client.<%= group.gsub(".", "_") %>_<%= name %><%= params_except_required.empty? ? '' : "(#{params_except_required})" %> }.to raise_error ArgumentError, /Required arguments :<%= arg_name %> missing/
|
|
17
17
|
end
|
|
18
18
|
<% end %>
|
data/lib/slack/web/config.rb
CHANGED
|
@@ -16,6 +16,7 @@ module Slack
|
|
|
16
16
|
open_timeout
|
|
17
17
|
default_page_size
|
|
18
18
|
default_max_retries
|
|
19
|
+
adapter
|
|
19
20
|
].freeze
|
|
20
21
|
|
|
21
22
|
attr_accessor(*Config::ATTRIBUTES)
|
|
@@ -32,6 +33,7 @@ module Slack
|
|
|
32
33
|
self.open_timeout = nil
|
|
33
34
|
self.default_page_size = 100
|
|
34
35
|
self.default_max_retries = 100
|
|
36
|
+
self.adapter = ::Faraday.default_adapter
|
|
35
37
|
end
|
|
36
38
|
end
|
|
37
39
|
|
|
@@ -6,29 +6,32 @@ module Slack
|
|
|
6
6
|
private
|
|
7
7
|
|
|
8
8
|
def connection
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
@connection ||=
|
|
10
|
+
begin
|
|
11
|
+
options = {
|
|
12
|
+
headers: { 'Accept' => 'application/json; charset=utf-8' }
|
|
13
|
+
}
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
options[:headers]['User-Agent'] = user_agent if user_agent
|
|
16
|
+
options[:proxy] = proxy if proxy
|
|
17
|
+
options[:ssl] = { ca_path: ca_path, ca_file: ca_file } if ca_path || ca_file
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
request_options = {}
|
|
20
|
+
request_options[:timeout] = timeout if timeout
|
|
21
|
+
request_options[:open_timeout] = open_timeout if open_timeout
|
|
22
|
+
options[:request] = request_options if request_options.any?
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
::Faraday::Connection.new(endpoint, options) do |connection|
|
|
25
|
+
connection.use ::Faraday::Request::Multipart
|
|
26
|
+
connection.use ::Faraday::Request::UrlEncoded
|
|
27
|
+
connection.use ::Slack::Web::Faraday::Response::RaiseError
|
|
28
|
+
connection.use ::FaradayMiddleware::Mashify, mash_class: Slack::Messages::Message
|
|
29
|
+
connection.use ::FaradayMiddleware::ParseJson
|
|
30
|
+
connection.use ::Slack::Web::Faraday::Response::WrapError
|
|
31
|
+
connection.response :logger, logger if logger
|
|
32
|
+
connection.adapter adapter
|
|
33
|
+
end
|
|
34
|
+
end
|
|
32
35
|
end
|
|
33
36
|
end
|
|
34
37
|
end
|
|
@@ -22,15 +22,16 @@ module Slack
|
|
|
22
22
|
private
|
|
23
23
|
|
|
24
24
|
def request(method, path, options)
|
|
25
|
-
options = options.merge(token: token)
|
|
26
25
|
response = connection.send(method) do |request|
|
|
27
26
|
case method
|
|
28
27
|
when :get, :delete
|
|
29
28
|
request.url(path, options)
|
|
30
29
|
when :post, :put
|
|
31
30
|
request.path = path
|
|
31
|
+
options.compact!
|
|
32
32
|
request.body = options unless options.empty?
|
|
33
33
|
end
|
|
34
|
+
request.headers['Authorization'] = "Bearer #{token}" if token
|
|
34
35
|
request.options.merge!(options.delete(:request)) if options.key?(:request)
|
|
35
36
|
end
|
|
36
37
|
response.body
|
|
@@ -6,7 +6,12 @@ module Slack
|
|
|
6
6
|
class RaiseError < ::Faraday::Response::Middleware
|
|
7
7
|
def on_complete(env)
|
|
8
8
|
raise Slack::Web::Api::Errors::TooManyRequestsError, env.response if env.status == 429
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
return unless env.success?
|
|
11
|
+
|
|
12
|
+
body = env.body
|
|
13
|
+
return unless body
|
|
14
|
+
return if body['ok']
|
|
10
15
|
|
|
11
16
|
error_message =
|
|
12
17
|
body['error'] || body['errors'].map { |message| message['error'] }.join(',')
|
|
@@ -15,6 +20,12 @@ module Slack
|
|
|
15
20
|
error_class ||= Slack::Web::Api::Errors::SlackError
|
|
16
21
|
raise error_class.new(error_message, env.response)
|
|
17
22
|
end
|
|
23
|
+
|
|
24
|
+
def call(env)
|
|
25
|
+
super
|
|
26
|
+
rescue ::Faraday::ParsingError
|
|
27
|
+
raise Slack::Web::Api::Errors::ParsingError, env.response
|
|
28
|
+
end
|
|
18
29
|
end
|
|
19
30
|
end
|
|
20
31
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Slack
|
|
3
|
+
module Web
|
|
4
|
+
module Faraday
|
|
5
|
+
module Response
|
|
6
|
+
class WrapError < ::Faraday::Response::Middleware
|
|
7
|
+
UNAVAILABLE_ERROR_STATUSES = (500..599).freeze
|
|
8
|
+
|
|
9
|
+
def on_complete(env)
|
|
10
|
+
return unless UNAVAILABLE_ERROR_STATUSES.cover?(env.status)
|
|
11
|
+
|
|
12
|
+
raise Slack::Web::Api::Errors::UnavailableError, env.response
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def call(env)
|
|
16
|
+
super
|
|
17
|
+
rescue ::Faraday::TimeoutError, ::Faraday::ConnectionFailed
|
|
18
|
+
raise Slack::Web::Api::Errors::TimeoutError, env.response
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -6,11 +6,7 @@ module Slack
|
|
|
6
6
|
class Cursor
|
|
7
7
|
include Enumerable
|
|
8
8
|
|
|
9
|
-
attr_reader :client
|
|
10
|
-
attr_reader :verb
|
|
11
|
-
attr_reader :sleep_interval
|
|
12
|
-
attr_reader :max_retries
|
|
13
|
-
attr_reader :params
|
|
9
|
+
attr_reader :client, :verb, :sleep_interval, :max_retries, :params
|
|
14
10
|
|
|
15
11
|
def initialize(client, verb, params = {})
|
|
16
12
|
@client = client
|
|
@@ -32,14 +28,14 @@ module Slack
|
|
|
32
28
|
|
|
33
29
|
client.logger.debug("#{self.class}##{__method__}") { e.to_s }
|
|
34
30
|
retry_count += 1
|
|
35
|
-
sleep(e.retry_after
|
|
31
|
+
sleep(e.retry_after)
|
|
36
32
|
next
|
|
37
33
|
end
|
|
38
34
|
yield response
|
|
39
35
|
break unless response.response_metadata
|
|
40
36
|
|
|
41
37
|
next_cursor = response.response_metadata.next_cursor
|
|
42
|
-
break if next_cursor.
|
|
38
|
+
break if next_cursor.nil? || next_cursor == ''
|
|
43
39
|
|
|
44
40
|
retry_count = 0
|
|
45
41
|
sleep(sleep_interval) if sleep_interval
|
data/lib/slack-ruby-client.rb
CHANGED
|
@@ -15,12 +15,12 @@ require 'json'
|
|
|
15
15
|
require 'logger'
|
|
16
16
|
begin
|
|
17
17
|
require 'picky'
|
|
18
|
-
rescue LoadError # rubocop:disable Lint/
|
|
18
|
+
rescue LoadError # rubocop:disable Lint/SuppressedException
|
|
19
19
|
# ignore, only used in users_search
|
|
20
20
|
end
|
|
21
21
|
begin
|
|
22
22
|
require 'openssl'
|
|
23
|
-
rescue LoadError # rubocop:disable Lint/
|
|
23
|
+
rescue LoadError # rubocop:disable Lint/SuppressedException
|
|
24
24
|
# Used in slack/web/config
|
|
25
25
|
end
|
|
26
26
|
require_relative 'slack/web/config'
|
|
@@ -28,7 +28,9 @@ require_relative 'slack/web/api/errors/slack_error'
|
|
|
28
28
|
require_relative 'slack/web/api/errors/too_many_requests_error'
|
|
29
29
|
require_relative 'slack/web/api/error'
|
|
30
30
|
require_relative 'slack/web/api/errors'
|
|
31
|
+
require_relative 'slack/web/api/errors/server_error'
|
|
31
32
|
require_relative 'slack/web/faraday/response/raise_error'
|
|
33
|
+
require_relative 'slack/web/faraday/response/wrap_error'
|
|
32
34
|
require_relative 'slack/web/faraday/connection'
|
|
33
35
|
require_relative 'slack/web/faraday/request'
|
|
34
36
|
require_relative 'slack/web/api/mixins'
|
|
@@ -37,8 +39,6 @@ require_relative 'slack/web/pagination/cursor'
|
|
|
37
39
|
require_relative 'slack/web/client'
|
|
38
40
|
|
|
39
41
|
# RealTime API
|
|
40
|
-
require 'active_support'
|
|
41
|
-
require 'active_support/core_ext'
|
|
42
42
|
require_relative 'slack/real_time/concurrency'
|
|
43
43
|
require_relative 'slack/real_time/socket'
|
|
44
44
|
require_relative 'slack/real_time/api/message_id'
|
data/lib/tasks/web.rake
CHANGED
|
@@ -32,6 +32,10 @@ namespace :slack do
|
|
|
32
32
|
parsed = JSON.parse(File.read(path))
|
|
33
33
|
parsed['undocumented'] = true if path =~ /undocumented/
|
|
34
34
|
JSON::Validator.validate(method_schema, parsed, insert_defaults: true)
|
|
35
|
+
if parsed['deprecated'] && parsed['deprecation']['deprecation_warning'] =~ /It will stop functioning in February 2021/
|
|
36
|
+
next
|
|
37
|
+
end
|
|
38
|
+
|
|
35
39
|
result[prefix][name] = parsed
|
|
36
40
|
end
|
|
37
41
|
|
|
@@ -51,10 +55,14 @@ namespace :slack do
|
|
|
51
55
|
rendered_method_spec = method_spec_template.result(group: group, names: names)
|
|
52
56
|
File.write "spec/slack/web/api/endpoints/#{snaked_group}_spec.rb", rendered_method_spec
|
|
53
57
|
end
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
|
|
59
|
+
unless ENV.key?('SKIP_PATCH')
|
|
60
|
+
Dir.glob("lib/slack/web/api/patches/#{group}*.patch").sort.each do |patch|
|
|
61
|
+
puts "- patching #{patch}"
|
|
62
|
+
system("git apply #{patch}") || raise('failed to apply patch')
|
|
63
|
+
end
|
|
57
64
|
end
|
|
65
|
+
|
|
58
66
|
# command
|
|
59
67
|
raise "Missing group #{group}" unless groups.key?(group)
|
|
60
68
|
|
data/slack-ruby-client.gemspec
CHANGED
|
@@ -12,24 +12,23 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
s.platform = Gem::Platform::RUBY
|
|
13
13
|
s.required_rubygems_version = '>= 1.3.6'
|
|
14
14
|
s.files = `git ls-files`.split("\n")
|
|
15
|
-
s.test_files = `git ls-files -- spec/*`.split("\n")
|
|
16
15
|
s.require_paths = ['lib']
|
|
17
16
|
s.homepage = 'http://github.com/slack-ruby/slack-ruby-client'
|
|
18
17
|
s.licenses = ['MIT']
|
|
19
18
|
s.summary = 'Slack Web and RealTime API client.'
|
|
20
|
-
s.add_dependency '
|
|
21
|
-
s.add_dependency 'faraday', '>= 0.9'
|
|
19
|
+
s.add_dependency 'faraday', '>= 1.0'
|
|
22
20
|
s.add_dependency 'faraday_middleware'
|
|
23
21
|
s.add_dependency 'gli'
|
|
24
22
|
s.add_dependency 'hashie'
|
|
25
23
|
s.add_dependency 'websocket-driver'
|
|
24
|
+
s.add_development_dependency 'activesupport'
|
|
26
25
|
s.add_development_dependency 'erubis'
|
|
27
26
|
s.add_development_dependency 'json-schema'
|
|
28
|
-
s.add_development_dependency 'rake', '~>
|
|
27
|
+
s.add_development_dependency 'rake', '~> 13'
|
|
29
28
|
s.add_development_dependency 'rspec'
|
|
30
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
|
31
|
-
s.add_development_dependency 'rubocop-performance', '~> 1.
|
|
32
|
-
s.add_development_dependency 'rubocop-rspec', '~> 1.
|
|
29
|
+
s.add_development_dependency 'rubocop', '~> 0.93.1'
|
|
30
|
+
s.add_development_dependency 'rubocop-performance', '~> 1.5.2'
|
|
31
|
+
s.add_development_dependency 'rubocop-rspec', '~> 1.39.0'
|
|
33
32
|
s.add_development_dependency 'timecop'
|
|
34
33
|
s.add_development_dependency 'vcr'
|
|
35
34
|
s.add_development_dependency 'webmock'
|
|
@@ -5,47 +5,14 @@ http_interactions:
|
|
|
5
5
|
uri: https://slack.com/api/auth.test
|
|
6
6
|
body:
|
|
7
7
|
encoding: UTF-8
|
|
8
|
-
string: token=
|
|
9
|
-
headers:
|
|
10
|
-
Accept:
|
|
11
|
-
- application/json; charset=utf-8
|
|
12
|
-
User-Agent:
|
|
13
|
-
- Slack Ruby Client 0.1.0
|
|
14
|
-
Content-Type:
|
|
15
|
-
- application/x-www-form-urlencoded
|
|
16
|
-
Accept-Encoding:
|
|
17
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
18
|
-
response:
|
|
19
|
-
status:
|
|
20
|
-
code: 429
|
|
21
|
-
message: OK
|
|
22
|
-
headers:
|
|
23
|
-
Access-Control-Allow-Origin:
|
|
24
|
-
- '*'
|
|
25
|
-
Retry-After:
|
|
26
|
-
- 3600
|
|
27
|
-
Date:
|
|
28
|
-
- Sat, 25 Jul 2015 14:42:07 GMT
|
|
29
|
-
Server:
|
|
30
|
-
- Apache
|
|
31
|
-
Connection:
|
|
32
|
-
- keep-alive
|
|
33
|
-
body:
|
|
34
|
-
encoding: US-ASCII
|
|
35
8
|
string: ''
|
|
36
|
-
http_version:
|
|
37
|
-
recorded_at: Sat, 25 Jul 2015 14:42:08 GMT
|
|
38
|
-
- request:
|
|
39
|
-
method: post
|
|
40
|
-
uri: https://slack.com/api/auth.test
|
|
41
|
-
body:
|
|
42
|
-
encoding: UTF-8
|
|
43
|
-
string: token
|
|
44
9
|
headers:
|
|
45
10
|
Accept:
|
|
46
11
|
- application/json; charset=utf-8
|
|
47
12
|
User-Agent:
|
|
48
|
-
- Slack Ruby Client/0.
|
|
13
|
+
- Slack Ruby Client/0.18.0
|
|
14
|
+
Authorization:
|
|
15
|
+
- Bearer <SLACK_API_TOKEN>
|
|
49
16
|
Content-Type:
|
|
50
17
|
- application/x-www-form-urlencoded
|
|
51
18
|
Accept-Encoding:
|
|
@@ -55,31 +22,60 @@ http_interactions:
|
|
|
55
22
|
code: 200
|
|
56
23
|
message: OK
|
|
57
24
|
headers:
|
|
58
|
-
Access-Control-Allow-Origin:
|
|
59
|
-
- '*'
|
|
60
|
-
Content-Security-Policy:
|
|
61
|
-
- referrer no-referrer;
|
|
62
|
-
Content-Type:
|
|
63
|
-
- application/json; charset=utf-8
|
|
64
25
|
Date:
|
|
65
|
-
-
|
|
26
|
+
- Sat, 04 Dec 2021 20:13:19 GMT
|
|
66
27
|
Server:
|
|
67
28
|
- Apache
|
|
29
|
+
Access-Control-Allow-Origin:
|
|
30
|
+
- "*"
|
|
31
|
+
Referrer-Policy:
|
|
32
|
+
- no-referrer
|
|
33
|
+
X-Slack-Backend:
|
|
34
|
+
- r
|
|
68
35
|
Strict-Transport-Security:
|
|
69
36
|
- max-age=31536000; includeSubDomains; preload
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
-
|
|
37
|
+
Access-Control-Allow-Headers:
|
|
38
|
+
- slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid,
|
|
39
|
+
x-b3-sampled, x-b3-flags
|
|
40
|
+
Access-Control-Expose-Headers:
|
|
41
|
+
- x-slack-req-id, retry-after
|
|
42
|
+
X-Oauth-Scopes:
|
|
43
|
+
- identify,read,post,client,apps
|
|
44
|
+
Expires:
|
|
45
|
+
- Mon, 26 Jul 1997 05:00:00 GMT
|
|
46
|
+
Cache-Control:
|
|
47
|
+
- private, no-cache, no-store, must-revalidate
|
|
48
|
+
Pragma:
|
|
49
|
+
- no-cache
|
|
74
50
|
X-Xss-Protection:
|
|
75
51
|
- '0'
|
|
52
|
+
X-Content-Type-Options:
|
|
53
|
+
- nosniff
|
|
54
|
+
X-Slack-Req-Id:
|
|
55
|
+
- 19b143ea43a655dcdc6c3debd59c41c0
|
|
56
|
+
Vary:
|
|
57
|
+
- Accept-Encoding
|
|
76
58
|
Content-Length:
|
|
77
|
-
- '
|
|
78
|
-
|
|
79
|
-
-
|
|
59
|
+
- '165'
|
|
60
|
+
Content-Type:
|
|
61
|
+
- application/json; charset=utf-8
|
|
62
|
+
X-Envoy-Upstream-Service-Time:
|
|
63
|
+
- '18'
|
|
64
|
+
X-Backend:
|
|
65
|
+
- main_normal main_bedrock_normal_with_overflow main_canary_with_overflow main_bedrock_canary_with_overflow
|
|
66
|
+
main_control_with_overflow main_bedrock_control_with_overflow
|
|
67
|
+
X-Server:
|
|
68
|
+
- slack-www-hhvm-main-iad-d5j5
|
|
69
|
+
X-Slack-Shared-Secret-Outcome:
|
|
70
|
+
- no-match
|
|
71
|
+
Via:
|
|
72
|
+
- envoy-www-iad-tdcc, envoy-edge-iad-olsk
|
|
73
|
+
X-Edge-Backend:
|
|
74
|
+
- envoy-www
|
|
75
|
+
X-Slack-Edge-Shared-Secret-Outcome:
|
|
76
|
+
- no-match
|
|
80
77
|
body:
|
|
81
78
|
encoding: UTF-8
|
|
82
|
-
string: '{"ok":
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
recorded_with: VCR 2.9.3
|
|
79
|
+
string: '{"ok":true,"url":"https:\/\/dblockdotorg.slack.com\/","team":"dblock","user":"travis-ci","team_id":"T04KB5WQH","user_id":"U0J1GAHN1","bot_id":"B0J1L75DY","is_enterprise_install":false}'
|
|
80
|
+
recorded_at: Sat, 19 Jan 2019 21:25:48 GMT
|
|
81
|
+
recorded_with: VCR 6.0.0
|