slack-ruby-client 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/{integtest.yml → integration_test.yml} +6 -5
- data/.github/workflows/{rubocop.yml → lint.yml} +5 -4
- data/.github/workflows/{danger.yml → pr_lint.yml} +8 -6
- data/.github/workflows/test.yml +4 -2
- data/.gitignore +0 -1
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +8 -14
- data/.ruby-version +1 -0
- data/CHANGELOG.md +14 -0
- data/CONTRIBUTING.md +5 -4
- data/Gemfile +1 -6
- data/README.md +60 -63
- data/RELEASING.md +1 -1
- data/UPGRADING.md +28 -0
- data/bin/commands/admin_audit_anomaly_allow.rb +23 -0
- data/bin/commands/admin_conversations.rb +12 -11
- data/bin/commands/admin_users.rb +1 -1
- data/bin/commands/admin_users_session.rb +1 -1
- data/bin/commands/apps_connections.rb +2 -2
- data/bin/commands/bookmarks.rb +1 -0
- data/bin/commands/chat.rb +9 -6
- data/bin/commands/conversations.rb +8 -6
- data/bin/commands/files.rb +24 -0
- data/bin/commands/rtm.rb +0 -15
- data/bin/commands/views.rb +4 -2
- data/bin/commands.rb +1 -0
- data/bin/slack +1 -1
- data/lib/slack/real_time/api/message.rb +3 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
- data/lib/slack/real_time/api/typing.rb +2 -1
- data/lib/slack/real_time/client.rb +8 -26
- data/lib/slack/real_time/config.rb +3 -3
- data/lib/slack/real_time/models/channel.rb +4 -0
- data/lib/slack/real_time/models/{group.rb → mpim.rb} +1 -1
- data/lib/slack/real_time/models.rb +2 -1
- data/lib/slack/real_time/stores/base.rb +25 -9
- data/lib/slack/real_time/stores/starter.rb +323 -309
- data/lib/slack/real_time/stores/store.rb +265 -198
- data/lib/slack/real_time/stores.rb +1 -7
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_apps.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_barriers.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_conversations.rb +30 -28
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_emoji.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +11 -11
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_users.rb +16 -16
- data/lib/slack/web/api/endpoints/admin_users_session.rb +8 -8
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_manifest.rb +6 -6
- data/lib/slack/web/api/endpoints/bookmarks.rb +10 -8
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/calls.rb +5 -5
- data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
- data/lib/slack/web/api/endpoints/chat.rb +36 -30
- data/lib/slack/web/api/endpoints/conversations.rb +37 -33
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +45 -8
- data/lib/slack/web/api/endpoints/files_comments.rb +2 -2
- data/lib/slack/web/api/endpoints/files_remote.rb +8 -8
- data/lib/slack/web/api/endpoints/migration.rb +1 -1
- data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
- data/lib/slack/web/api/endpoints/pins.rb +3 -3
- data/lib/slack/web/api/endpoints/reactions.rb +4 -4
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +0 -23
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +4 -4
- data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -3
- data/lib/slack/web/api/endpoints/users.rb +4 -4
- data/lib/slack/web/api/endpoints/users_admin.rb +2 -2
- data/lib/slack/web/api/endpoints/views.rb +16 -11
- data/lib/slack/web/api/endpoints/workflows.rb +4 -4
- data/lib/slack/web/api/endpoints.rb +2 -0
- data/lib/slack/web/api/errors.rb +56 -6
- data/lib/slack/web/api/mixins/conversations.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.search.rb +2 -1
- data/lib/slack/web/api/patches/{chat.1.patch → chat.attachments-blocks.patch} +13 -14
- data/lib/slack/web/api/patches/{dialog.1.open-json-support.patch → dialog.encoded-json.patch} +4 -4
- data/lib/slack/web/api/patches/views.view-json.patch +55 -0
- data/lib/slack/web/api/templates/method.erb +1 -1
- data/lib/slack/web/config.rb +2 -2
- data/lib/tasks/real_time.rake +44 -22
- data/lib/tasks/web.rake +9 -2
- data/spec/fixtures/slack/web/rtm_connect.yml +85 -1
- data/spec/slack/events/config_spec.rb +2 -0
- data/spec/slack/events/request_spec.rb +4 -0
- data/spec/slack/messages/formatting_spec.rb +10 -0
- data/spec/slack/real_time/api/message_spec.rb +1 -1
- data/spec/slack/real_time/api/ping_spec.rb +1 -1
- data/spec/slack/real_time/api/typing_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +73 -111
- data/spec/slack/real_time/event_handlers/bot_spec.rb +19 -17
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +28 -25
- data/spec/slack/real_time/event_handlers/{group_spec.rb → private_channel_spec.rb} +35 -27
- data/spec/slack/real_time/event_handlers/{channel_spec.rb → public_channel_spec.rb} +24 -20
- data/spec/slack/real_time/event_handlers/team_spec.rb +7 -8
- data/spec/slack/real_time/event_handlers/user_spec.rb +6 -5
- data/spec/slack/real_time/stores/store_spec.rb +50 -0
- data/spec/slack/slack_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +17 -1
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +2 -0
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +13 -4
- data/spec/slack/web/api/endpoints/files_spec.rb +13 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +2 -0
- data/spec/slack/web/api/mixins/users_spec.rb +2 -0
- data/spec/slack/web/api/pagination/cursor_spec.rb +4 -0
- data/spec/slack/web/client_spec.rb +14 -4
- data/spec/support/real_time/loaded_client.rb +120 -0
- metadata +18 -35
- data/bin/commands/admin_conversations_whitelist.rb +0 -37
- data/bin/commands/apps_permissions.rb +0 -23
- data/bin/commands/apps_permissions_resources.rb +0 -15
- data/bin/commands/apps_permissions_scopes.rb +0 -13
- data/bin/commands/apps_permissions_users.rb +0 -26
- data/bin/commands/channels.rb +0 -23
- data/bin/commands/groups.rb +0 -14
- data/bin/commands/im.rb +0 -6
- data/bin/commands/mpim.rb +0 -6
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +0 -64
- data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -36
- data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +0 -31
- data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +0 -21
- data/lib/slack/web/api/endpoints/apps_permissions_users.rb +0 -50
- data/lib/slack/web/api/endpoints/channels.rb +0 -25
- data/lib/slack/web/api/endpoints/groups.rb +0 -13
- data/lib/slack/web/api/endpoints/im.rb +0 -13
- data/lib/slack/web/api/endpoints/mpim.rb +0 -13
- data/lib/slack/web/api/endpoints/presence.rb +0 -23
- data/lib/slack/web/api/patches/views.1.view-json.patch +0 -40
- data/lib/slack/web/api/patches/views.1.views-published.patch +0 -16
- data/spec/fixtures/slack/web/rtm_start.yml +0 -815
- data/spec/slack/real_time/rtm_start_spec.rb +0 -14
- data/spec/slack/real_time/store_spec.rb +0 -12
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# require 'spec_helper'
|
3
|
-
|
4
|
-
#
|
5
|
-
# to re-record a rtm_start fixture run with
|
6
|
-
# SLACK_API_TOKEN=... CONCURRENCY=async-websocket rspec spec/slack/real_time/rtm_start_spec.rb
|
7
|
-
# edit rtm_start.yml and remove the token, fix wss:// path (run specs, fix failures)
|
8
|
-
#
|
9
|
-
|
10
|
-
# RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' } do
|
11
|
-
# it 'connects' do
|
12
|
-
# Slack::Web::Client.new.rtm_start(mpim_aware: true)
|
13
|
-
# end
|
14
|
-
# end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Slack::RealTime::Store do
|
5
|
-
it 'can be initialized with an empty hash' do
|
6
|
-
store = described_class.new(Hashie::Mash.new)
|
7
|
-
expect(store.self).to be_nil
|
8
|
-
expect(store.groups.count).to eq 0
|
9
|
-
expect(store.team).to be_nil
|
10
|
-
expect(store.teams.count).to eq 0
|
11
|
-
end
|
12
|
-
end
|