slack-ruby-client 0.7.2 → 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 +5 -5
- data/.github/FUNDING.yml +1 -0
- data/.gitignore +2 -0
- data/.gitmodules +1 -1
- data/.rubocop.yml +37 -1
- data/.rubocop_todo.yml +130 -47
- data/.travis.yml +17 -13
- data/CHANGELOG.md +254 -43
- data/CONTRIBUTING.md +26 -15
- data/Dangerfile +3 -0
- data/Gemfile +13 -2
- data/LICENSE.md +1 -1
- data/README.md +287 -63
- data/RELEASING.md +22 -14
- data/Rakefile +2 -1
- data/UPGRADING.md +129 -5
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +51 -0
- data/bin/commands/admin_apps_approved.rb +17 -0
- data/bin/commands/admin_apps_requests.rb +17 -0
- data/bin/commands/admin_apps_restricted.rb +17 -0
- data/bin/commands/admin_auth_policy.rb +39 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +169 -0
- 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 +54 -0
- data/bin/commands/admin_inviteRequests.rb +36 -0
- data/bin/commands/admin_inviteRequests_approved.rb +16 -0
- data/bin/commands/admin_inviteRequests_denied.rb +16 -0
- data/bin/commands/admin_teams.rb +27 -0
- data/bin/commands/admin_teams_admins.rb +16 -0
- data/bin/commands/admin_teams_owners.rb +16 -0
- data/bin/commands/admin_teams_settings.rb +64 -0
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +98 -0
- data/bin/commands/admin_users_session.rb +78 -0
- data/bin/commands/api.rb +3 -3
- data/bin/commands/apps.rb +15 -0
- 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/apps_permissions.rb +23 -0
- data/bin/commands/apps_permissions_resources.rb +15 -0
- data/bin/commands/apps_permissions_scopes.rb +13 -0
- data/bin/commands/apps_permissions_users.rb +26 -0
- data/bin/commands/auth.rb +12 -2
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +15 -0
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +6 -132
- data/bin/commands/chat.rb +127 -20
- data/bin/commands/chat_scheduledMessages.rb +19 -0
- data/bin/commands/conversations.rb +253 -0
- data/bin/commands/dialog.rb +15 -0
- data/bin/commands/dnd.rb +12 -9
- data/bin/commands/emoji.rb +3 -2
- data/bin/commands/files.rb +47 -31
- data/bin/commands/files_comments.rb +3 -23
- data/bin/commands/files_remote.rb +78 -0
- data/bin/commands/groups.rb +1 -154
- data/bin/commands/im.rb +1 -48
- data/bin/commands/migration.rb +16 -0
- data/bin/commands/mpim.rb +1 -48
- data/bin/commands/oauth.rb +4 -2
- data/bin/commands/oauth_v2.rb +29 -0
- data/bin/commands/openid_connect.rb +27 -0
- data/bin/commands/pins.rb +9 -12
- data/bin/commands/reactions.rb +17 -15
- data/bin/commands/reminders.rb +17 -10
- data/bin/commands/rtm.rb +19 -4
- data/bin/commands/search.rb +17 -12
- data/bin/commands/stars.rb +12 -9
- data/bin/commands/team.rb +23 -8
- data/bin/commands/team_billing.rb +13 -0
- data/bin/commands/team_preferences.rb +13 -0
- data/bin/commands/team_profile.rb +14 -0
- data/bin/commands/tooling_tokens.rb +14 -0
- data/bin/commands/usergroups.rb +23 -17
- data/bin/commands/usergroups_users.rb +7 -4
- data/bin/commands/users.rb +83 -27
- data/bin/commands/users_admin.rb +29 -0
- data/bin/commands/users_prefs.rb +13 -0
- data/bin/commands/users_profile.rb +27 -0
- data/bin/commands/views.rb +48 -0
- data/bin/commands/workflows.rb +38 -0
- data/bin/commands.rb +47 -5
- data/bin/slack +3 -4
- data/examples/hi_real_time_and_web/Gemfile +1 -0
- data/examples/hi_real_time_and_web/hi.rb +8 -4
- data/examples/{hi_real_time_async_celluloid → hi_real_time_async_async}/Gemfile +2 -1
- data/examples/{hi_real_time_async_celluloid → hi_real_time_async_async}/Procfile +0 -0
- data/examples/{hi_real_time_async_celluloid → hi_real_time_async_async}/hi.rb +13 -8
- data/examples/hi_web/Gemfile +1 -0
- data/examples/hi_web/hi.rb +2 -1
- data/examples/new_ticket/Gemfile +1 -0
- data/examples/new_ticket/new_ticket.rb +3 -2
- data/lib/slack/config.rb +2 -2
- data/lib/slack/events/config.rb +32 -0
- data/lib/slack/events/request.rb +72 -0
- data/lib/slack/logger.rb +6 -5
- data/lib/slack/messages/formatting.rb +4 -4
- data/lib/slack/messages/message.rb +6 -4
- data/lib/slack/real_time/api/message.rb +3 -1
- data/lib/slack/real_time/api/message_id.rb +1 -0
- data/lib/slack/real_time/api/ping.rb +5 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +1 -1
- data/lib/slack/real_time/api/typing.rb +3 -1
- data/lib/slack/real_time/client.rb +116 -36
- data/lib/slack/real_time/concurrency/async.rb +138 -0
- data/lib/slack/real_time/concurrency.rb +2 -2
- data/lib/slack/real_time/config.rb +17 -19
- data/lib/slack/real_time/models/base.rb +3 -3
- data/lib/slack/real_time/models/bot.rb +1 -0
- data/lib/slack/real_time/models/channel.rb +1 -0
- data/lib/slack/real_time/models/group.rb +1 -0
- data/lib/slack/real_time/models/im.rb +1 -0
- data/lib/slack/real_time/models/team.rb +1 -0
- data/lib/slack/real_time/models/user.rb +1 -0
- data/lib/slack/real_time/models.rb +8 -7
- data/lib/slack/real_time/socket.rb +51 -23
- data/lib/slack/real_time/stores/base.rb +6 -9
- data/lib/slack/real_time/stores/starter.rb +143 -69
- data/lib/slack/real_time/stores/store.rb +160 -82
- data/lib/slack/real_time/stores.rb +4 -3
- data/lib/slack/version.rb +2 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +78 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
- 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 +260 -0
- 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 +88 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +163 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +122 -0
- data/lib/slack/web/api/endpoints/api.rb +4 -5
- data/lib/slack/web/api/endpoints/apps.rb +27 -0
- 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/apps_permissions.rb +36 -0
- data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +31 -0
- data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_permissions_users.rb +50 -0
- data/lib/slack/web/api/endpoints/auth.rb +14 -2
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +25 -0
- 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 +8 -201
- data/lib/slack/web/api/endpoints/chat.rb +252 -42
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +40 -0
- data/lib/slack/web/api/endpoints/conversations.rb +422 -0
- data/lib/slack/web/api/endpoints/dialog.rb +33 -0
- data/lib/slack/web/api/endpoints/dnd.rb +17 -12
- data/lib/slack/web/api/endpoints/emoji.rb +3 -2
- data/lib/slack/web/api/endpoints/files.rb +82 -43
- data/lib/slack/web/api/endpoints/files_comments.rb +4 -36
- data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
- data/lib/slack/web/api/endpoints/groups.rb +1 -235
- data/lib/slack/web/api/endpoints/im.rb +1 -73
- data/lib/slack/web/api/endpoints/migration.rb +28 -0
- data/lib/slack/web/api/endpoints/mpim.rb +1 -72
- data/lib/slack/web/api/endpoints/oauth.rb +9 -10
- data/lib/slack/web/api/endpoints/oauth_v2.rb +48 -0
- data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
- data/lib/slack/web/api/endpoints/pins.rb +14 -23
- data/lib/slack/web/api/endpoints/presence.rb +1 -1
- data/lib/slack/web/api/endpoints/reactions.rb +43 -34
- data/lib/slack/web/api/endpoints/reminders.rb +28 -15
- data/lib/slack/web/api/endpoints/rtm.rb +29 -8
- data/lib/slack/web/api/endpoints/search.rb +39 -24
- data/lib/slack/web/api/endpoints/stars.rb +30 -22
- data/lib/slack/web/api/endpoints/team.rb +34 -11
- 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 +23 -0
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +43 -32
- data/lib/slack/web/api/endpoints/usergroups_users.rb +14 -9
- data/lib/slack/web/api/endpoints/users.rb +104 -19
- data/lib/slack/web/api/endpoints/users_admin.rb +49 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +21 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +44 -0
- data/lib/slack/web/api/endpoints/views.rb +97 -0
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/endpoints.rb +111 -29
- data/lib/slack/web/api/error.rb +2 -8
- data/lib/slack/web/api/errors/server_error.rb +37 -0
- data/lib/slack/web/api/errors/slack_error.rb +29 -0
- data/lib/slack/web/api/errors/too_many_requests_error.rb +21 -0
- data/lib/slack/web/api/errors.rb +1040 -0
- data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
- data/lib/slack/web/api/mixins/ids.id.rb +24 -0
- data/lib/slack/web/api/mixins/users.id.rb +6 -7
- data/lib/slack/web/api/mixins/users.search.rb +39 -36
- data/lib/slack/web/api/mixins.rb +4 -4
- data/lib/slack/web/api/patches/chat.1.patch +70 -0
- data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
- data/lib/slack/web/api/patches/views.1.view-json.patch +40 -0
- data/lib/slack/web/api/patches/views.1.views-published.patch +16 -0
- data/lib/slack/web/api/templates/command.erb +5 -3
- data/lib/slack/web/api/templates/commands.erb +2 -1
- data/lib/slack/web/api/templates/endpoints.erb +5 -5
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/api/templates/method.erb +26 -4
- data/lib/slack/web/api/templates/method_spec.erb +3 -2
- data/lib/slack/web/client.rb +2 -1
- data/lib/slack/web/config.rb +21 -10
- data/lib/slack/web/faraday/connection.rb +25 -16
- data/lib/slack/web/faraday/request.rb +4 -1
- data/lib/slack/web/faraday/response/raise_error.rb +19 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +48 -0
- data/lib/slack-ruby-client.rb +40 -26
- data/lib/slack.rb +1 -0
- data/lib/slack_ruby_client.rb +1 -0
- data/lib/tasks/git.rake +2 -1
- data/lib/tasks/real_time.rake +16 -6
- data/lib/tasks/update.rake +1 -0
- data/lib/tasks/web.rake +42 -10
- data/screenshots/create-app.png +0 -0
- data/slack-ruby-client.gemspec +11 -9
- data/spec/fixtures/slack/web/429_error.yml +50 -52
- 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 +613 -0
- data/spec/fixtures/slack/web/rtm_connect.yml +307 -0
- 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 +83 -0
- data/spec/integration/integration_spec.rb +116 -48
- data/spec/slack/config_spec.rb +2 -0
- data/spec/slack/events/config_spec.rb +33 -0
- data/spec/slack/events/request_spec.rb +184 -0
- data/spec/slack/messages/formatting_spec.rb +25 -14
- data/spec/slack/real_time/api/message_spec.rb +6 -1
- data/spec/slack/real_time/api/ping_spec.rb +2 -0
- data/spec/slack/real_time/api/typing_spec.rb +5 -1
- data/spec/slack/real_time/client_spec.rb +465 -141
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +21 -0
- 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 +7 -4
- data/spec/slack/real_time/event_handlers/channel_spec.rb +10 -7
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +3 -2
- data/spec/slack/real_time/event_handlers/group_spec.rb +5 -4
- data/spec/slack/real_time/event_handlers/im_spec.rb +9 -8
- data/spec/slack/real_time/event_handlers/team_spec.rb +8 -4
- data/spec/slack/real_time/event_handlers/user_spec.rb +7 -4
- data/spec/slack/real_time/rtm_connect_spec.rb +14 -0
- data/spec/slack/real_time/rtm_start_spec.rb +2 -1
- data/spec/slack/real_time/store_spec.rb +2 -1
- data/spec/slack/slack_spec.rb +42 -8
- data/spec/slack/version_spec.rb +2 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +18 -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/admin_conversations_ekm_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +98 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +41 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
- data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
- 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 +16 -0
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/bots_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/chat_scheduledMessages_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +11 -4
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +140 -24
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +36 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +22 -7
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +95 -0
- data/spec/slack/web/api/endpoints/dnd_spec.rb +4 -3
- data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +3 -21
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/files_spec.rb +17 -5
- data/spec/slack/web/api/endpoints/migration_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/oauth_spec.rb +1 -11
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
- data/spec/slack/web/api/endpoints/reminders_spec.rb +3 -2
- data/spec/slack/web/api/endpoints/rtm_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/search_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/stars_spec.rb +1 -0
- 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/team_profile_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/team_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/usergroups_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +3 -2
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/api/error_spec.rb +7 -7
- data/spec/slack/web/api/errors/slack_error_spec.rb +33 -0
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +43 -0
- data/spec/slack/web/api/mixins/users_spec.rb +30 -17
- data/spec/slack/web/api/pagination/cursor_spec.rb +98 -0
- data/spec/slack/web/client_spec.rb +211 -14
- data/spec/slack/web/faraday/request_spec.rb +80 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +86 -0
- data/spec/spec_helper.rb +9 -2
- data/spec/support/queue_with_timeout.rb +6 -5
- data/spec/support/real_time/concurrency/mock.rb +2 -2
- data/spec/support/real_time/connected_client.rb +7 -2
- data/spec/support/real_time/event.rb +1 -0
- data/spec/support/token.rb +1 -0
- data/spec/support/vcr.rb +37 -1
- metadata +250 -130
- data/examples/hi_real_time/Gemfile +0 -5
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -37
- data/examples/hi_real_time_async/Gemfile +0 -5
- data/examples/hi_real_time_async/hi.rb +0 -29
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -6
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -36
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -100
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -60
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/channels.id.rb +0 -26
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -26
- 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 -20
- data/screenshots/register-bot.png +0 -0
- 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 -35
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -50
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -11
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -11
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -30
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -30
- data/spec/slack/web/api/mixins/channels_spec.rb +0 -31
- data/spec/slack/web/api/mixins/groups_spec.rb +0 -31
@@ -1,12 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Slack
|
2
3
|
module Web
|
3
4
|
module Faraday
|
4
5
|
module Response
|
5
6
|
class RaiseError < ::Faraday::Response::Middleware
|
6
7
|
def on_complete(env)
|
8
|
+
raise Slack::Web::Api::Errors::TooManyRequestsError, env.response if env.status == 429
|
9
|
+
|
10
|
+
return unless env.success?
|
11
|
+
|
7
12
|
body = env.body
|
13
|
+
return unless body
|
8
14
|
return if body['ok']
|
9
|
-
|
15
|
+
|
16
|
+
error_message =
|
17
|
+
body['error'] || body['errors'].map { |message| message['error'] }.join(',')
|
18
|
+
|
19
|
+
error_class = Slack::Web::Api::Errors::ERROR_CLASSES[error_message]
|
20
|
+
error_class ||= Slack::Web::Api::Errors::SlackError
|
21
|
+
raise error_class.new(error_message, env.response)
|
22
|
+
end
|
23
|
+
|
24
|
+
def call(env)
|
25
|
+
super
|
26
|
+
rescue ::Faraday::ParsingError
|
27
|
+
raise Slack::Web::Api::Errors::ParsingError, env.response
|
10
28
|
end
|
11
29
|
end
|
12
30
|
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
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Slack
|
3
|
+
module Web
|
4
|
+
module Api
|
5
|
+
module Pagination
|
6
|
+
class Cursor
|
7
|
+
include Enumerable
|
8
|
+
|
9
|
+
attr_reader :client, :verb, :sleep_interval, :max_retries, :params
|
10
|
+
|
11
|
+
def initialize(client, verb, params = {})
|
12
|
+
@client = client
|
13
|
+
@verb = verb
|
14
|
+
@params = params.dup
|
15
|
+
@sleep_interval = @params.delete(:sleep_interval)
|
16
|
+
@max_retries = @params.delete(:max_retries) || client.default_max_retries
|
17
|
+
end
|
18
|
+
|
19
|
+
def each
|
20
|
+
next_cursor = nil
|
21
|
+
retry_count = 0
|
22
|
+
loop do
|
23
|
+
query = { limit: client.default_page_size }.merge(params).merge(cursor: next_cursor)
|
24
|
+
begin
|
25
|
+
response = client.send(verb, query)
|
26
|
+
rescue Slack::Web::Api::Errors::TooManyRequestsError => e
|
27
|
+
raise e if retry_count >= max_retries
|
28
|
+
|
29
|
+
client.logger.debug("#{self.class}##{__method__}") { e.to_s }
|
30
|
+
retry_count += 1
|
31
|
+
sleep(e.retry_after)
|
32
|
+
next
|
33
|
+
end
|
34
|
+
yield response
|
35
|
+
break unless response.response_metadata
|
36
|
+
|
37
|
+
next_cursor = response.response_metadata.next_cursor
|
38
|
+
break if next_cursor.nil? || next_cursor == ''
|
39
|
+
|
40
|
+
retry_count = 0
|
41
|
+
sleep(sleep_interval) if sleep_interval
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/slack-ruby-client.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative 'slack/version'
|
3
|
+
require_relative 'slack/logger'
|
4
|
+
require_relative 'slack/config'
|
4
5
|
|
5
6
|
# Messages
|
6
7
|
require 'hashie'
|
7
|
-
|
8
|
-
|
8
|
+
require_relative 'slack/messages/message'
|
9
|
+
require_relative 'slack/messages/formatting'
|
9
10
|
|
10
11
|
# Web API
|
11
12
|
require 'faraday'
|
@@ -14,28 +15,41 @@ require 'json'
|
|
14
15
|
require 'logger'
|
15
16
|
begin
|
16
17
|
require 'picky'
|
17
|
-
rescue LoadError
|
18
|
+
rescue LoadError # rubocop:disable Lint/SuppressedException
|
18
19
|
# ignore, only used in users_search
|
19
20
|
end
|
20
|
-
|
21
|
-
require '
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
begin
|
22
|
+
require 'openssl'
|
23
|
+
rescue LoadError # rubocop:disable Lint/SuppressedException
|
24
|
+
# Used in slack/web/config
|
25
|
+
end
|
26
|
+
require_relative 'slack/web/config'
|
27
|
+
require_relative 'slack/web/api/errors/slack_error'
|
28
|
+
require_relative 'slack/web/api/errors/too_many_requests_error'
|
29
|
+
require_relative 'slack/web/api/error'
|
30
|
+
require_relative 'slack/web/api/errors'
|
31
|
+
require_relative 'slack/web/api/errors/server_error'
|
32
|
+
require_relative 'slack/web/faraday/response/raise_error'
|
33
|
+
require_relative 'slack/web/faraday/response/wrap_error'
|
34
|
+
require_relative 'slack/web/faraday/connection'
|
35
|
+
require_relative 'slack/web/faraday/request'
|
36
|
+
require_relative 'slack/web/api/mixins'
|
37
|
+
require_relative 'slack/web/api/endpoints'
|
38
|
+
require_relative 'slack/web/pagination/cursor'
|
39
|
+
require_relative 'slack/web/client'
|
28
40
|
|
29
41
|
# RealTime API
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
+
require_relative 'slack/real_time/concurrency'
|
43
|
+
require_relative 'slack/real_time/socket'
|
44
|
+
require_relative 'slack/real_time/api/message_id'
|
45
|
+
require_relative 'slack/real_time/api/ping'
|
46
|
+
require_relative 'slack/real_time/api/message'
|
47
|
+
require_relative 'slack/real_time/api/typing'
|
48
|
+
require_relative 'slack/real_time/models'
|
49
|
+
require_relative 'slack/real_time/stores'
|
50
|
+
require_relative 'slack/real_time/config'
|
51
|
+
require_relative 'slack/real_time/client'
|
52
|
+
|
53
|
+
# Events API
|
54
|
+
require_relative 'slack/events/config'
|
55
|
+
require_relative 'slack/events/request'
|
data/lib/slack.rb
CHANGED
data/lib/slack_ruby_client.rb
CHANGED
data/lib/tasks/git.rake
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
namespace :slack do
|
2
|
-
# update slack-api-ref from https://github.com/
|
3
|
+
# update slack-api-ref from https://github.com/slack-ruby/slack-api-ref
|
3
4
|
task :git_update do
|
4
5
|
sh 'git submodule update --init --recursive'
|
5
6
|
sh 'git submodule foreach git pull origin master'
|
data/lib/tasks/real_time.rake
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# largely from https://github.com/aki017/slack-ruby-gem
|
2
3
|
require 'json-schema'
|
3
4
|
require 'erubis'
|
@@ -5,22 +6,26 @@ require 'erubis'
|
|
5
6
|
namespace :slack do
|
6
7
|
namespace :real_time do
|
7
8
|
namespace :api do
|
8
|
-
REAL_TIME_EVENTS_MARKER = '### RealTime Events'
|
9
|
+
REAL_TIME_EVENTS_MARKER = '### RealTime Events'
|
9
10
|
|
10
|
-
desc 'Update API.'
|
11
|
+
desc 'Update Real Time API.'
|
11
12
|
task update: [:git_update] do
|
12
13
|
event_schema = JSON.parse(File.read('lib/slack/real_time/api/schema/event.json'))
|
13
|
-
|
14
|
+
dirglob = 'lib/slack/web/api/slack-api-ref/events/**/*.json'
|
15
|
+
events = Dir.glob(dirglob).each_with_object({}) do |path, result|
|
14
16
|
name = File.basename(path, '.json')
|
15
17
|
parsed = JSON.parse(File.read(path))
|
16
18
|
JSON::Validator.validate(event_schema, parsed, insert_defaults: true)
|
17
|
-
next if %w
|
19
|
+
next if %w[message hello].include?(name)
|
20
|
+
|
18
21
|
result[name] = parsed
|
19
22
|
end
|
20
23
|
|
21
|
-
event_handler_template =
|
24
|
+
event_handler_template =
|
25
|
+
Erubis::Eruby.new(File.read('lib/slack/real_time/api/templates/event_handler.erb'))
|
22
26
|
Dir.glob('lib/slack/real_time/stores/**/*.rb').each do |store_file|
|
23
27
|
next if File.basename(store_file) == 'base.rb'
|
28
|
+
|
24
29
|
STDOUT.write "#{File.basename(store_file)}:"
|
25
30
|
|
26
31
|
store_file_contents = File.read(store_file)
|
@@ -35,7 +40,12 @@ namespace :slack do
|
|
35
40
|
desc: event_data['desc']
|
36
41
|
)
|
37
42
|
|
38
|
-
store_file_contents.gsub!
|
43
|
+
store_file_contents.gsub!(
|
44
|
+
REAL_TIME_EVENTS_MARKER,
|
45
|
+
REAL_TIME_EVENTS_MARKER +
|
46
|
+
"\n\n" +
|
47
|
+
rendered_event_handler.rstrip
|
48
|
+
)
|
39
49
|
end
|
40
50
|
end
|
41
51
|
|
data/lib/tasks/update.rake
CHANGED
data/lib/tasks/web.rake
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# largely from https://github.com/aki017/slack-ruby-gem
|
2
3
|
require 'json-schema'
|
3
4
|
require 'erubis'
|
@@ -7,12 +8,14 @@ require 'active_support/core_ext'
|
|
7
8
|
namespace :slack do
|
8
9
|
namespace :web do
|
9
10
|
namespace :api do
|
10
|
-
desc 'Update API.'
|
11
|
+
desc 'Update Web API.'
|
11
12
|
task update: [:git_update] do
|
12
13
|
group_schema = JSON.parse(File.read('lib/slack/web/api/schema/group.json'))
|
13
|
-
|
14
|
+
dirglob = 'lib/slack/web/api/slack-api-ref/groups/**/*.json'
|
15
|
+
groups = Dir.glob(dirglob).each_with_object({}) do |path, result|
|
14
16
|
name = File.basename(path, '.json')
|
15
17
|
parsed = JSON.parse(File.read(path))
|
18
|
+
parsed['undocumented'] = true if path =~ /undocumented/
|
16
19
|
JSON::Validator.validate(group_schema, parsed, insert_defaults: true)
|
17
20
|
result[name] = parsed
|
18
21
|
end
|
@@ -27,12 +30,18 @@ namespace :slack do
|
|
27
30
|
name = file_name.split('.')[-1]
|
28
31
|
result[prefix] ||= {}
|
29
32
|
parsed = JSON.parse(File.read(path))
|
33
|
+
parsed['undocumented'] = true if path =~ /undocumented/
|
30
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
|
+
|
31
39
|
result[prefix][name] = parsed
|
32
40
|
end
|
33
41
|
|
34
42
|
method_template = Erubis::Eruby.new(File.read('lib/slack/web/api/templates/method.erb'))
|
35
|
-
method_spec_template =
|
43
|
+
method_spec_template =
|
44
|
+
Erubis::Eruby.new(File.read('lib/slack/web/api/templates/method_spec.erb'))
|
36
45
|
command_template = Erubis::Eruby.new(File.read('lib/slack/web/api/templates/command.erb'))
|
37
46
|
data.each_with_index do |(group, names), index|
|
38
47
|
printf "%2d/%2d %10s %s\n", index, data.size, group, names.keys
|
@@ -40,25 +49,48 @@ namespace :slack do
|
|
40
49
|
snaked_group = group.tr('.', '_')
|
41
50
|
rendered_method = method_template.result(group: group, names: names)
|
42
51
|
File.write "lib/slack/web/api/endpoints/#{snaked_group}.rb", rendered_method
|
43
|
-
custom_spec_exists =
|
52
|
+
custom_spec_exists =
|
53
|
+
File.exist?("spec/slack/web/api/endpoints/custom_specs/#{group}_spec.rb")
|
44
54
|
unless custom_spec_exists
|
45
55
|
rendered_method_spec = method_spec_template.result(group: group, names: names)
|
46
56
|
File.write "spec/slack/web/api/endpoints/#{snaked_group}_spec.rb", rendered_method_spec
|
47
57
|
end
|
48
|
-
|
49
|
-
|
50
|
-
|
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
|
51
64
|
end
|
65
|
+
|
52
66
|
# command
|
67
|
+
raise "Missing group #{group}" unless groups.key?(group)
|
68
|
+
|
53
69
|
rendered_command = command_template.result(group: groups[group], names: names)
|
54
70
|
File.write "bin/commands/#{snaked_group}.rb", rendered_command
|
55
71
|
end
|
56
72
|
|
57
|
-
endpoints_template =
|
58
|
-
|
73
|
+
endpoints_template =
|
74
|
+
Erubis::Eruby.new(File.read('lib/slack/web/api/templates/endpoints.erb'))
|
75
|
+
File.write(
|
76
|
+
'lib/slack/web/api/endpoints.rb',
|
77
|
+
endpoints_template.result(files: data.keys.map { |key| key.tr('.', '_') })
|
78
|
+
)
|
59
79
|
|
60
80
|
commands_template = Erubis::Eruby.new(File.read('lib/slack/web/api/templates/commands.erb'))
|
61
|
-
File.write
|
81
|
+
File.write(
|
82
|
+
'bin/commands.rb',
|
83
|
+
commands_template.result(files: data.keys.map { |key| key.tr('.', '_') })
|
84
|
+
)
|
85
|
+
|
86
|
+
errors_template = Erubis::Eruby.new(File.read('lib/slack/web/api/templates/errors.erb'))
|
87
|
+
errors = data.values.map do |names|
|
88
|
+
names.values.map do |d|
|
89
|
+
d['errors'].keys
|
90
|
+
end
|
91
|
+
end.flatten.compact.uniq.sort
|
92
|
+
rendered_errors = errors_template.result(errors: errors)
|
93
|
+
File.write('lib/slack/web/api/errors.rb', rendered_errors)
|
62
94
|
end
|
63
95
|
end
|
64
96
|
end
|
Binary file
|
data/slack-ruby-client.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
2
3
|
require 'slack/version'
|
3
4
|
|
4
5
|
Gem::Specification.new do |s|
|
@@ -11,23 +12,24 @@ Gem::Specification.new do |s|
|
|
11
12
|
s.platform = Gem::Platform::RUBY
|
12
13
|
s.required_rubygems_version = '>= 1.3.6'
|
13
14
|
s.files = `git ls-files`.split("\n")
|
14
|
-
s.test_files = `git ls-files -- spec/*`.split("\n")
|
15
15
|
s.require_paths = ['lib']
|
16
|
-
s.homepage = 'http://github.com/
|
16
|
+
s.homepage = 'http://github.com/slack-ruby/slack-ruby-client'
|
17
17
|
s.licenses = ['MIT']
|
18
18
|
s.summary = 'Slack Web and RealTime API client.'
|
19
|
-
s.add_dependency '
|
20
|
-
s.add_dependency 'faraday'
|
19
|
+
s.add_dependency 'faraday', '>= 1.0'
|
21
20
|
s.add_dependency 'faraday_middleware'
|
22
|
-
s.add_dependency 'json'
|
23
|
-
s.add_dependency 'websocket-driver'
|
24
21
|
s.add_dependency 'gli'
|
25
22
|
s.add_dependency 'hashie'
|
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'
|
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'
|
32
|
+
s.add_development_dependency 'timecop'
|
30
33
|
s.add_development_dependency 'vcr'
|
31
34
|
s.add_development_dependency 'webmock'
|
32
|
-
s.add_development_dependency 'rubocop', '0.35.0'
|
33
35
|
end
|
@@ -5,45 +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
|
-
Date:
|
26
|
-
- Sat, 25 Jul 2015 14:42:07 GMT
|
27
|
-
Server:
|
28
|
-
- Apache
|
29
|
-
Connection:
|
30
|
-
- keep-alive
|
31
|
-
body:
|
32
|
-
encoding: US-ASCII
|
33
8
|
string: ''
|
34
|
-
http_version:
|
35
|
-
recorded_at: Sat, 25 Jul 2015 14:42:08 GMT
|
36
|
-
- request:
|
37
|
-
method: post
|
38
|
-
uri: https://slack.com/api/auth.test
|
39
|
-
body:
|
40
|
-
encoding: UTF-8
|
41
|
-
string: token
|
42
9
|
headers:
|
43
10
|
Accept:
|
44
11
|
- application/json; charset=utf-8
|
45
12
|
User-Agent:
|
46
|
-
- Slack Ruby Client/0.
|
13
|
+
- Slack Ruby Client/0.18.0
|
14
|
+
Authorization:
|
15
|
+
- Bearer <SLACK_API_TOKEN>
|
47
16
|
Content-Type:
|
48
17
|
- application/x-www-form-urlencoded
|
49
18
|
Accept-Encoding:
|
@@ -53,31 +22,60 @@ http_interactions:
|
|
53
22
|
code: 200
|
54
23
|
message: OK
|
55
24
|
headers:
|
56
|
-
Access-Control-Allow-Origin:
|
57
|
-
- '*'
|
58
|
-
Content-Security-Policy:
|
59
|
-
- referrer no-referrer;
|
60
|
-
Content-Type:
|
61
|
-
- application/json; charset=utf-8
|
62
25
|
Date:
|
63
|
-
-
|
26
|
+
- Sat, 04 Dec 2021 20:13:19 GMT
|
64
27
|
Server:
|
65
28
|
- Apache
|
29
|
+
Access-Control-Allow-Origin:
|
30
|
+
- "*"
|
31
|
+
Referrer-Policy:
|
32
|
+
- no-referrer
|
33
|
+
X-Slack-Backend:
|
34
|
+
- r
|
66
35
|
Strict-Transport-Security:
|
67
36
|
- max-age=31536000; includeSubDomains; preload
|
68
|
-
|
69
|
-
-
|
70
|
-
|
71
|
-
-
|
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
|
72
50
|
X-Xss-Protection:
|
73
51
|
- '0'
|
52
|
+
X-Content-Type-Options:
|
53
|
+
- nosniff
|
54
|
+
X-Slack-Req-Id:
|
55
|
+
- 19b143ea43a655dcdc6c3debd59c41c0
|
56
|
+
Vary:
|
57
|
+
- Accept-Encoding
|
74
58
|
Content-Length:
|
75
|
-
- '
|
76
|
-
|
77
|
-
-
|
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
|
78
77
|
body:
|
79
78
|
encoding: UTF-8
|
80
|
-
string: '{"ok":
|
81
|
-
|
82
|
-
|
83
|
-
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
|
@@ -5,14 +5,16 @@ http_interactions:
|
|
5
5
|
uri: https://slack.com/api/auth.test
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string:
|
8
|
+
string: ''
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- application/json; charset=utf-8
|
12
12
|
User-Agent:
|
13
|
-
- Slack Ruby Client
|
14
|
-
|
15
|
-
-
|
13
|
+
- Slack Ruby Client/0.18.0
|
14
|
+
Authorization:
|
15
|
+
- Bearer <SLACK_API_TOKEN>
|
16
|
+
Content-Length:
|
17
|
+
- '0'
|
16
18
|
Accept-Encoding:
|
17
19
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
20
|
response:
|
@@ -20,29 +22,60 @@ http_interactions:
|
|
20
22
|
code: 200
|
21
23
|
message: OK
|
22
24
|
headers:
|
23
|
-
Access-Control-Allow-Origin:
|
24
|
-
- "*"
|
25
|
-
Content-Type:
|
26
|
-
- application/json; charset=utf-8
|
27
25
|
Date:
|
28
|
-
- Sat,
|
26
|
+
- Sat, 04 Dec 2021 20:13:18 GMT
|
29
27
|
Server:
|
30
28
|
- Apache
|
29
|
+
Access-Control-Allow-Origin:
|
30
|
+
- "*"
|
31
|
+
Referrer-Policy:
|
32
|
+
- no-referrer
|
33
|
+
X-Slack-Backend:
|
34
|
+
- r
|
31
35
|
Strict-Transport-Security:
|
32
36
|
- max-age=31536000; includeSubDomains; preload
|
33
|
-
|
34
|
-
-
|
35
|
-
|
36
|
-
-
|
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
|
+
Expires:
|
43
|
+
- Mon, 26 Jul 1997 05:00:00 GMT
|
44
|
+
Cache-Control:
|
45
|
+
- private, no-cache, no-store, must-revalidate
|
46
|
+
Pragma:
|
47
|
+
- no-cache
|
48
|
+
X-Robots-Tag:
|
49
|
+
- noindex,nofollow
|
37
50
|
X-Xss-Protection:
|
38
51
|
- '0'
|
52
|
+
X-Content-Type-Options:
|
53
|
+
- nosniff
|
54
|
+
X-Slack-Req-Id:
|
55
|
+
- ad5ac4ccd453f8d6e46e1cc41d6d8a7a
|
56
|
+
Vary:
|
57
|
+
- Accept-Encoding
|
39
58
|
Content-Length:
|
40
59
|
- '53'
|
41
|
-
|
42
|
-
-
|
60
|
+
Content-Type:
|
61
|
+
- application/json; charset=utf-8
|
62
|
+
X-Envoy-Upstream-Service-Time:
|
63
|
+
- '5'
|
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-6qbu
|
69
|
+
X-Slack-Shared-Secret-Outcome:
|
70
|
+
- no-match
|
71
|
+
Via:
|
72
|
+
- envoy-www-iad-fsrl, envoy-edge-iad-m7rj
|
73
|
+
X-Edge-Backend:
|
74
|
+
- envoy-www
|
75
|
+
X-Slack-Edge-Shared-Secret-Outcome:
|
76
|
+
- no-match
|
43
77
|
body:
|
44
78
|
encoding: UTF-8
|
45
79
|
string: '{"ok":false,"error":"not_authed"}'
|
46
|
-
|
47
|
-
|
48
|
-
recorded_with: VCR 2.9.3
|
80
|
+
recorded_at: Sat, 19 Jan 2019 21:25:48 GMT
|
81
|
+
recorded_with: VCR 6.0.0
|