slack-ruby-client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/integration_test.yml +19 -0
  4. data/.github/workflows/pr_lint.yml +1 -1
  5. data/.github/workflows/test.yml +1 -0
  6. data/CHANGELOG.md +9 -0
  7. data/README.md +18 -14
  8. data/SECURITY.md +9 -0
  9. data/bin/commands/admin_analytics.rb +16 -10
  10. data/bin/commands/admin_apps.rb +48 -42
  11. data/bin/commands/admin_apps_approved.rb +17 -11
  12. data/bin/commands/admin_apps_requests.rb +27 -21
  13. data/bin/commands/admin_apps_restricted.rb +17 -11
  14. data/bin/commands/admin_audit_anomaly_allow.rb +22 -16
  15. data/bin/commands/admin_auth_policy.rb +37 -31
  16. data/bin/commands/admin_barriers.rb +44 -38
  17. data/bin/commands/admin_conversations.rb +221 -165
  18. data/bin/commands/admin_conversations_ekm.rb +17 -11
  19. data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
  20. data/bin/commands/admin_emoji.rb +50 -44
  21. data/bin/commands/admin_inviteRequests.rb +34 -28
  22. data/bin/commands/admin_inviteRequests_approved.rb +16 -10
  23. data/bin/commands/admin_inviteRequests_denied.rb +16 -10
  24. data/bin/commands/admin_roles.rb +46 -0
  25. data/bin/commands/admin_teams.rb +26 -20
  26. data/bin/commands/admin_teams_admins.rb +16 -10
  27. data/bin/commands/admin_teams_owners.rb +16 -10
  28. data/bin/commands/admin_teams_settings.rb +59 -53
  29. data/bin/commands/admin_usergroups.rb +45 -39
  30. data/bin/commands/admin_users.rb +91 -85
  31. data/bin/commands/admin_users_session.rb +72 -66
  32. data/bin/commands/admin_users_unsupportedVersions.rb +15 -9
  33. data/bin/commands/api.rb +14 -8
  34. data/bin/commands/apps.rb +15 -9
  35. data/bin/commands/apps_connections.rb +13 -7
  36. data/bin/commands/apps_event_authorizations.rb +16 -10
  37. data/bin/commands/apps_manifest.rb +48 -42
  38. data/bin/commands/auth.rb +21 -15
  39. data/bin/commands/auth_teams.rb +16 -10
  40. data/bin/commands/bookmarks.rb +50 -44
  41. data/bin/commands/bots.rb +15 -9
  42. data/bin/commands/calls.rb +49 -43
  43. data/bin/commands/calls_participants.rb +24 -18
  44. data/bin/commands/chat.rb +150 -144
  45. data/bin/commands/chat_scheduledMessages.rb +19 -13
  46. data/bin/commands/conversations.rb +233 -227
  47. data/bin/commands/dialog.rb +15 -9
  48. data/bin/commands/dnd.rb +46 -40
  49. data/bin/commands/emoji.rb +14 -7
  50. data/bin/commands/files.rb +110 -105
  51. data/bin/commands/files_comments.rb +15 -9
  52. data/bin/commands/files_remote.rb +73 -67
  53. data/bin/commands/functions_workflows_steps.rb +22 -0
  54. data/bin/commands/functions_workflows_steps_responses.rb +22 -0
  55. data/bin/commands/migration.rb +16 -10
  56. data/bin/commands/oauth.rb +18 -12
  57. data/bin/commands/oauth_v2.rb +28 -22
  58. data/bin/commands/openid_connect.rb +26 -20
  59. data/bin/commands/pins.rb +33 -26
  60. data/bin/commands/reactions.rb +52 -46
  61. data/bin/commands/reminders.rb +53 -47
  62. data/bin/commands/rtm.rb +15 -9
  63. data/bin/commands/search.rb +43 -37
  64. data/bin/commands/stars.rb +38 -32
  65. data/bin/commands/team.rb +47 -39
  66. data/bin/commands/team_billing.rb +13 -7
  67. data/bin/commands/team_preferences.rb +13 -7
  68. data/bin/commands/team_profile.rb +14 -8
  69. data/bin/commands/tooling_tokens.rb +14 -8
  70. data/bin/commands/usergroups.rb +64 -58
  71. data/bin/commands/usergroups_users.rb +27 -21
  72. data/bin/commands/users.rb +111 -105
  73. data/bin/commands/users_admin.rb +28 -22
  74. data/bin/commands/users_prefs.rb +13 -7
  75. data/bin/commands/users_profile.rb +26 -20
  76. data/bin/commands/views.rb +47 -41
  77. data/bin/commands/workflows.rb +36 -30
  78. data/bin/slack +48 -43
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
  81. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
  82. data/lib/slack/web/api/endpoints/admin_conversations.rb +78 -0
  83. data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
  84. data/lib/slack/web/api/endpoints/chat.rb +2 -2
  85. data/lib/slack/web/api/endpoints/conversations.rb +1 -1
  86. data/lib/slack/web/api/endpoints/emoji.rb +2 -0
  87. data/lib/slack/web/api/endpoints/files.rb +0 -2
  88. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
  89. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
  90. data/lib/slack/web/api/endpoints/pins.rb +2 -0
  91. data/lib/slack/web/api/endpoints/team.rb +11 -1
  92. data/lib/slack/web/api/endpoints/usergroups.rb +1 -1
  93. data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
  94. data/lib/slack/web/api/endpoints.rb +6 -0
  95. data/lib/slack/web/api/errors.rb +62 -0
  96. data/lib/slack/web/api/templates/command.erb +18 -12
  97. data/lib/tasks/web.rake +0 -6
  98. data/slack-ruby-client.gemspec +0 -1
  99. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
  100. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
  101. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
  102. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
  103. metadata +13 -19
  104. data/bin/commands.rb +0 -69
  105. data/lib/slack/web/api/templates/commands.erb +0 -6
@@ -8,6 +8,7 @@ module Slack
8
8
  class AccessDenied < SlackError; end
9
9
  class Accesslimited < SlackError; end
10
10
  class AccountInactive < SlackError; end
11
+ class ActionAlreadyInProgress < SlackError; end
11
12
  class AdminUnauthorized < SlackError; end
12
13
  class AlreadyApproved < SlackError; end
13
14
  class AlreadyArchived < SlackError; end
@@ -30,6 +31,7 @@ module Slack
30
31
  class AsUserNotSupported < SlackError; end
31
32
  class AtLeastOneSessionSettingRequired < SlackError; end
32
33
  class AuthMismatch < SlackError; end
34
+ class AuthorizationNotFound < SlackError; end
33
35
  class AutoProvisionFailure < SlackError; end
34
36
  class BadClientSecret < SlackError; end
35
37
  class BadHandle < SlackError; end
@@ -44,6 +46,7 @@ module Slack
44
46
  class BarrierNotFound < SlackError; end
45
47
  class BarrieredFromUsergroupsNotFound < SlackError; end
46
48
  class BlockMismatch < SlackError; end
49
+ class BlockedFileType < SlackError; end
47
50
  class BotNotFound < SlackError; end
48
51
  class BotUserRequired < SlackError; end
49
52
  class BotsNotAllowed < SlackError; end
@@ -76,6 +79,7 @@ module Slack
76
79
  class CannotPrompt < SlackError; end
77
80
  class CannotResetBot < SlackError; end
78
81
  class CannotResetPrimaryOwner < SlackError; end
82
+ class CannotResolveAlias < SlackError; end
79
83
  class CannotSetBothNumMinutesAndIsIndefinite < SlackError; end
80
84
  class CannotSetThisGuestToRegularAtTeamLevel < SlackError; end
81
85
  class CannotShareCrossWorkspaceChannel < SlackError; end
@@ -95,13 +99,17 @@ module Slack
95
99
  class CantKickSelf < SlackError; end
96
100
  class CantLeaveGeneral < SlackError; end
97
101
  class CantUpdateMessage < SlackError; end
102
+ class CanvasDisabledFileTeam < SlackError; end
103
+ class CanvasDisabledUserTeam < SlackError; end
98
104
  class ChannelArchived < SlackError; end
99
105
  class ChannelCannotBeUnshared < SlackError; end
106
+ class ChannelCanvasDeleted < SlackError; end
100
107
  class ChannelConversionInProgress < SlackError; end
101
108
  class ChannelIsNotPrivate < SlackError; end
102
109
  class ChannelMentionSyncRequired < SlackError; end
103
110
  class ChannelNotArchived < SlackError; end
104
111
  class ChannelNotFound < SlackError; end
112
+ class ChannelOwnerRestriction < SlackError; end
105
113
  class ChannelTypeNotSupported < SlackError; end
106
114
  class ClientIdTokenMismatch < SlackError; end
107
115
  class CodeAlreadyUsed < SlackError; end
@@ -127,6 +135,7 @@ module Slack
127
135
  class DataNotAvailable < SlackError; end
128
136
  class DefaultChannelRestricted < SlackError; end
129
137
  class DefaultOrgWideChannel < SlackError; end
138
+ class DeleteNotAllowed < SlackError; end
130
139
  class DeprecatedEndpoint < SlackError; end
131
140
  class DescriptionTooLong < SlackError; end
132
141
  class DiscoverabilitySettingInvalid < SlackError; end
@@ -158,13 +167,16 @@ module Slack
158
167
  class ExchangedTriggerId < SlackError; end
159
168
  class ExpiredTriggerId < SlackError; end
160
169
  class ExternalChannelMigrating < SlackError; end
170
+ class ExternalLimitedRestriction < SlackError; end
161
171
  class ExternalTeamNotConnectedToThisOrg < SlackError; end
162
172
  class ExternallySharedOrDisconnectedChannel < SlackError; end
163
173
  class FailToGetTeamsForRestrictedUser < SlackError; end
164
174
  class FailedAddingCollaborator < SlackError; end
165
175
  class FailedCreatingApp < SlackError; end
166
176
  class FailedExport < SlackError; end
177
+ class FailedForSomeEntities < SlackError; end
167
178
  class FailedForSomeUsers < SlackError; end
179
+ class FailedForSomeUsersAndEntities < SlackError; end
168
180
  class FailedLookingUpUser < SlackError; end
169
181
  class FailedSendingDialog < SlackError; end
170
182
  class FailedToAddEmoji < SlackError; end
@@ -194,6 +206,7 @@ module Slack
194
206
  class FailedToValidateTeam < SlackError; end
195
207
  class FailureRemovingEmoji < SlackError; end
196
208
  class FatalError < SlackError; end
209
+ class FeatureNotAvailable < SlackError; end
197
210
  class FeatureNotEnabled < SlackError; end
198
211
  class FetchMembersFailed < SlackError; end
199
212
  class FileCommentNotFound < SlackError; end
@@ -248,6 +261,7 @@ module Slack
248
261
  class InvalidEmail < SlackError; end
249
262
  class InvalidEmoji < SlackError; end
250
263
  class InvalidEmojiNotAllowed < SlackError; end
264
+ class InvalidEnterprise < SlackError; end
251
265
  class InvalidEntityId < SlackError; end
252
266
  class InvalidEventContext < SlackError; end
253
267
  class InvalidExternalId < SlackError; end
@@ -282,6 +296,7 @@ module Slack
282
296
  class InvalidRequestId < SlackError; end
283
297
  class InvalidRestrictedSubjects < SlackError; end
284
298
  class InvalidRoleForUser < SlackError; end
299
+ class InvalidRoleId < SlackError; end
285
300
  class InvalidScheduledMessageId < SlackError; end
286
301
  class InvalidScopes < SlackError; end
287
302
  class InvalidSearchChannelType < SlackError; end
@@ -392,6 +407,10 @@ module Slack
392
407
  class NoText < SlackError; end
393
408
  class NoUser < SlackError; end
394
409
  class NoUsersProvided < SlackError; end
410
+ class NoValidChannels < SlackError; end
411
+ class NoValidEntities < SlackError; end
412
+ class NoValidTeams < SlackError; end
413
+ class NoValidUsers < SlackError; end
395
414
  class NotAdmin < SlackError; end
396
415
  class NotAllowed < SlackError; end
397
416
  class NotAllowedForGridWorkspace < SlackError; end
@@ -435,6 +454,7 @@ module Slack
435
454
  class PermissionDenied < SlackError; end
436
455
  class PlanUpgradeRequired < SlackError; end
437
456
  class PolicyNotFound < SlackError; end
457
+ class PostContentsTooLarge < SlackError; end
438
458
  class PostingToChannelDenied < SlackError; end
439
459
  class PostingToGeneralChannelDenied < SlackError; end
440
460
  class PreviewFeatureNotAvailable < SlackError; end
@@ -467,9 +487,11 @@ module Slack
467
487
  class SessionNotFound < SlackError; end
468
488
  class SessionResetNotAllowed < SlackError; end
469
489
  class SlackConnectBlockedFileType < SlackError; end
490
+ class SlackConnectCanvasSharingBlocked < SlackError; end
470
491
  class SlackConnectClipSharingBlocked < SlackError; end
471
492
  class SlackConnectFileLinkSharingBlocked < SlackError; end
472
493
  class SlackConnectFileUploadSharingBlocked < SlackError; end
494
+ class SlackConnectTeamBlocked < SlackError; end
473
495
  class SnippetTooLarge < SlackError; end
474
496
  class SnoozeEndFailed < SlackError; end
475
497
  class SnoozeFailed < SlackError; end
@@ -477,6 +499,9 @@ module Slack
477
499
  class StorageLimitReached < SlackError; end
478
500
  class SubteamMaxUsersExceeded < SlackError; end
479
501
  class SudoRequired < SlackError; end
502
+ class TargetTeamMustBeSpecifiedInOrgContext < SlackError; end
503
+ class TargetTeamNotFound < SlackError; end
504
+ class TargetTeamNotOnOrg < SlackError; end
480
505
  class TeamAccessNotGranted < SlackError; end
481
506
  class TeamAddedToOrg < SlackError; end
482
507
  class TeamIdOrOrgRequired < SlackError; end
@@ -501,6 +526,7 @@ module Slack
501
526
  class TooManyConvosForTeam < SlackError; end
502
527
  class TooManyEmails < SlackError; end
503
528
  class TooManyEmoji < SlackError; end
529
+ class TooManyEntities < SlackError; end
504
530
  class TooManyFrames < SlackError; end
505
531
  class TooManyIds < SlackError; end
506
532
  class TooManyIdsProvided < SlackError; end
@@ -515,15 +541,20 @@ module Slack
515
541
  class TriggerExchanged < SlackError; end
516
542
  class TriggerExpired < SlackError; end
517
543
  class TwoFactorSetupRequired < SlackError; end
544
+ class UnableToFetchCustomEmojis < SlackError; end
518
545
  class UnableToLinkIdpGroupAndChannel < SlackError; end
519
546
  class UnableToProcessPostRequest < SlackError; end
520
547
  class UnableToUnlinkIdpGroupAndChannel < SlackError; end
521
548
  class UnableToUpdateExistingSessions < SlackError; end
549
+ class UnknownAppId < SlackError; end
522
550
  class UnknownError < SlackError; end
551
+ class UnknownFunctionId < SlackError; end
523
552
  class UnknownMethod < SlackError; end
524
553
  class UnknownSnippetType < SlackError; end
554
+ class UnknownStepId < SlackError; end
525
555
  class UnknownSubtype < SlackError; end
526
556
  class UnknownType < SlackError; end
557
+ class UnknownWorkflowId < SlackError; end
527
558
  class UnsupportedActionDescribe < SlackError; end
528
559
  class UnsupportedActionPut < SlackError; end
529
560
  class UnsupportedArguments < SlackError; end
@@ -561,6 +592,7 @@ module Slack
561
592
  'access_denied' => AccessDenied,
562
593
  'accesslimited' => Accesslimited,
563
594
  'account_inactive' => AccountInactive,
595
+ 'action_already_in_progress' => ActionAlreadyInProgress,
564
596
  'admin_unauthorized' => AdminUnauthorized,
565
597
  'already_approved' => AlreadyApproved,
566
598
  'already_archived' => AlreadyArchived,
@@ -583,6 +615,7 @@ module Slack
583
615
  'as_user_not_supported' => AsUserNotSupported,
584
616
  'at_least_one_session_setting_required' => AtLeastOneSessionSettingRequired,
585
617
  'auth_mismatch' => AuthMismatch,
618
+ 'authorization_not_found' => AuthorizationNotFound,
586
619
  'auto_provision_failure' => AutoProvisionFailure,
587
620
  'bad_client_secret' => BadClientSecret,
588
621
  'bad_handle' => BadHandle,
@@ -597,6 +630,7 @@ module Slack
597
630
  'barrier_not_found' => BarrierNotFound,
598
631
  'barriered_from_usergroups_not_found' => BarrieredFromUsergroupsNotFound,
599
632
  'block_mismatch' => BlockMismatch,
633
+ 'blocked_file_type' => BlockedFileType,
600
634
  'bot_not_found' => BotNotFound,
601
635
  'bot_user_required' => BotUserRequired,
602
636
  'bots_not_allowed' => BotsNotAllowed,
@@ -629,6 +663,7 @@ module Slack
629
663
  'cannot_prompt' => CannotPrompt,
630
664
  'cannot_reset_bot' => CannotResetBot,
631
665
  'cannot_reset_primary_owner' => CannotResetPrimaryOwner,
666
+ 'cannot_resolve_alias' => CannotResolveAlias,
632
667
  'cannot_set_both_num_minutes_and_is_indefinite' => CannotSetBothNumMinutesAndIsIndefinite,
633
668
  'cannot_set_this_guest_to_regular_at_team_level' => CannotSetThisGuestToRegularAtTeamLevel,
634
669
  'cannot_share_cross_workspace_channel' => CannotShareCrossWorkspaceChannel,
@@ -648,13 +683,17 @@ module Slack
648
683
  'cant_kick_self' => CantKickSelf,
649
684
  'cant_leave_general' => CantLeaveGeneral,
650
685
  'cant_update_message' => CantUpdateMessage,
686
+ 'canvas_disabled_file_team' => CanvasDisabledFileTeam,
687
+ 'canvas_disabled_user_team' => CanvasDisabledUserTeam,
651
688
  'channel_archived' => ChannelArchived,
652
689
  'channel_cannot_be_unshared' => ChannelCannotBeUnshared,
690
+ 'channel_canvas_deleted' => ChannelCanvasDeleted,
653
691
  'channel_conversion_in_progress' => ChannelConversionInProgress,
654
692
  'channel_is_not_private' => ChannelIsNotPrivate,
655
693
  'channel_mention_sync_required' => ChannelMentionSyncRequired,
656
694
  'channel_not_archived' => ChannelNotArchived,
657
695
  'channel_not_found' => ChannelNotFound,
696
+ 'channel_owner_restriction' => ChannelOwnerRestriction,
658
697
  'channel_type_not_supported' => ChannelTypeNotSupported,
659
698
  'client_id_token_mismatch' => ClientIdTokenMismatch,
660
699
  'code_already_used' => CodeAlreadyUsed,
@@ -680,6 +719,7 @@ module Slack
680
719
  'data_not_available' => DataNotAvailable,
681
720
  'default_channel_restricted' => DefaultChannelRestricted,
682
721
  'default_org_wide_channel' => DefaultOrgWideChannel,
722
+ 'delete_not_allowed' => DeleteNotAllowed,
683
723
  'deprecated_endpoint' => DeprecatedEndpoint,
684
724
  'description_too_long' => DescriptionTooLong,
685
725
  'discoverability_setting_invalid' => DiscoverabilitySettingInvalid,
@@ -711,13 +751,16 @@ module Slack
711
751
  'exchanged_trigger_id' => ExchangedTriggerId,
712
752
  'expired_trigger_id' => ExpiredTriggerId,
713
753
  'external_channel_migrating' => ExternalChannelMigrating,
754
+ 'external_limited_restriction' => ExternalLimitedRestriction,
714
755
  'external_team_not_connected_to_this_org' => ExternalTeamNotConnectedToThisOrg,
715
756
  'externally_shared_or_disconnected_channel' => ExternallySharedOrDisconnectedChannel,
716
757
  'fail_to_get_teams_for_restricted_user' => FailToGetTeamsForRestrictedUser,
717
758
  'failed_adding_collaborator' => FailedAddingCollaborator,
718
759
  'failed_creating_app' => FailedCreatingApp,
719
760
  'failed_export' => FailedExport,
761
+ 'failed_for_some_entities' => FailedForSomeEntities,
720
762
  'failed_for_some_users' => FailedForSomeUsers,
763
+ 'failed_for_some_users_and_entities' => FailedForSomeUsersAndEntities,
721
764
  'failed_looking_up_user' => FailedLookingUpUser,
722
765
  'failed_sending_dialog' => FailedSendingDialog,
723
766
  'failed_to_add_emoji' => FailedToAddEmoji,
@@ -747,6 +790,7 @@ module Slack
747
790
  'failed_to_validate_team' => FailedToValidateTeam,
748
791
  'failure_removing_emoji' => FailureRemovingEmoji,
749
792
  'fatal_error' => FatalError,
793
+ 'feature_not_available' => FeatureNotAvailable,
750
794
  'feature_not_enabled' => FeatureNotEnabled,
751
795
  'fetch_members_failed' => FetchMembersFailed,
752
796
  'file_comment_not_found' => FileCommentNotFound,
@@ -801,6 +845,7 @@ module Slack
801
845
  'invalid_email' => InvalidEmail,
802
846
  'invalid_emoji' => InvalidEmoji,
803
847
  'invalid_emoji_not_allowed' => InvalidEmojiNotAllowed,
848
+ 'invalid_enterprise' => InvalidEnterprise,
804
849
  'invalid_entity_id' => InvalidEntityId,
805
850
  'invalid_event_context' => InvalidEventContext,
806
851
  'invalid_external_id' => InvalidExternalId,
@@ -835,6 +880,7 @@ module Slack
835
880
  'invalid_request_id' => InvalidRequestId,
836
881
  'invalid_restricted_subjects' => InvalidRestrictedSubjects,
837
882
  'invalid_role_for_user' => InvalidRoleForUser,
883
+ 'invalid_role_id' => InvalidRoleId,
838
884
  'invalid_scheduled_message_id' => InvalidScheduledMessageId,
839
885
  'invalid_scopes' => InvalidScopes,
840
886
  'invalid_search_channel_type' => InvalidSearchChannelType,
@@ -945,6 +991,10 @@ module Slack
945
991
  'no_text' => NoText,
946
992
  'no_user' => NoUser,
947
993
  'no_users_provided' => NoUsersProvided,
994
+ 'no_valid_channels' => NoValidChannels,
995
+ 'no_valid_entities' => NoValidEntities,
996
+ 'no_valid_teams' => NoValidTeams,
997
+ 'no_valid_users' => NoValidUsers,
948
998
  'not_admin' => NotAdmin,
949
999
  'not_allowed' => NotAllowed,
950
1000
  'not_allowed_for_grid_workspace' => NotAllowedForGridWorkspace,
@@ -988,6 +1038,7 @@ module Slack
988
1038
  'permission_denied' => PermissionDenied,
989
1039
  'plan_upgrade_required' => PlanUpgradeRequired,
990
1040
  'policy_not_found' => PolicyNotFound,
1041
+ 'post_contents_too_large' => PostContentsTooLarge,
991
1042
  'posting_to_channel_denied' => PostingToChannelDenied,
992
1043
  'posting_to_general_channel_denied' => PostingToGeneralChannelDenied,
993
1044
  'preview_feature_not_available' => PreviewFeatureNotAvailable,
@@ -1020,9 +1071,11 @@ module Slack
1020
1071
  'session_not_found' => SessionNotFound,
1021
1072
  'session_reset_not_allowed' => SessionResetNotAllowed,
1022
1073
  'slack_connect_blocked_file_type' => SlackConnectBlockedFileType,
1074
+ 'slack_connect_canvas_sharing_blocked' => SlackConnectCanvasSharingBlocked,
1023
1075
  'slack_connect_clip_sharing_blocked' => SlackConnectClipSharingBlocked,
1024
1076
  'slack_connect_file_link_sharing_blocked' => SlackConnectFileLinkSharingBlocked,
1025
1077
  'slack_connect_file_upload_sharing_blocked' => SlackConnectFileUploadSharingBlocked,
1078
+ 'slack_connect_team_blocked' => SlackConnectTeamBlocked,
1026
1079
  'snippet_too_large' => SnippetTooLarge,
1027
1080
  'snooze_end_failed' => SnoozeEndFailed,
1028
1081
  'snooze_failed' => SnoozeFailed,
@@ -1030,6 +1083,9 @@ module Slack
1030
1083
  'storage_limit_reached' => StorageLimitReached,
1031
1084
  'subteam_max_users_exceeded' => SubteamMaxUsersExceeded,
1032
1085
  'sudo_required' => SudoRequired,
1086
+ 'target_team_must_be_specified_in_org_context' => TargetTeamMustBeSpecifiedInOrgContext,
1087
+ 'target_team_not_found' => TargetTeamNotFound,
1088
+ 'target_team_not_on_org' => TargetTeamNotOnOrg,
1033
1089
  'team_access_not_granted' => TeamAccessNotGranted,
1034
1090
  'team_added_to_org' => TeamAddedToOrg,
1035
1091
  'team_id_or_org_required' => TeamIdOrOrgRequired,
@@ -1054,6 +1110,7 @@ module Slack
1054
1110
  'too_many_convos_for_team' => TooManyConvosForTeam,
1055
1111
  'too_many_emails' => TooManyEmails,
1056
1112
  'too_many_emoji' => TooManyEmoji,
1113
+ 'too_many_entities' => TooManyEntities,
1057
1114
  'too_many_frames' => TooManyFrames,
1058
1115
  'too_many_ids' => TooManyIds,
1059
1116
  'too_many_ids_provided' => TooManyIdsProvided,
@@ -1068,15 +1125,20 @@ module Slack
1068
1125
  'trigger_exchanged' => TriggerExchanged,
1069
1126
  'trigger_expired' => TriggerExpired,
1070
1127
  'two_factor_setup_required' => TwoFactorSetupRequired,
1128
+ 'unable_to_fetch_custom_emojis' => UnableToFetchCustomEmojis,
1071
1129
  'unable_to_link_idp_group_and_channel' => UnableToLinkIdpGroupAndChannel,
1072
1130
  'unable_to_process_post_request' => UnableToProcessPostRequest,
1073
1131
  'unable_to_unlink_idp_group_and_channel' => UnableToUnlinkIdpGroupAndChannel,
1074
1132
  'unable_to_update_existing_sessions' => UnableToUpdateExistingSessions,
1133
+ 'unknown_app_id' => UnknownAppId,
1075
1134
  'unknown_error' => UnknownError,
1135
+ 'unknown_function_id' => UnknownFunctionId,
1076
1136
  'unknown_method' => UnknownMethod,
1077
1137
  'unknown_snippet_type' => UnknownSnippetType,
1138
+ 'unknown_step_id' => UnknownStepId,
1078
1139
  'unknown_subtype' => UnknownSubtype,
1079
1140
  'unknown_type' => UnknownType,
1141
+ 'unknown_workflow_id' => UnknownWorkflowId,
1080
1142
  'unsupported_action_describe' => UnsupportedActionDescribe,
1081
1143
  'unsupported_action_put' => UnsupportedActionPut,
1082
1144
  'unsupported_arguments' => UnsupportedArguments,
@@ -1,13 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
+ module Slack
5
+ module Cli
6
+ class App
4
7
  <% desc = group['desc'] || "#{group['name'].gsub(".", "_").camelize} methods." %>
5
8
  <% if desc.include?("'") %>
6
- desc "<%= desc %>"
9
+ desc "<%= desc %>"
7
10
  <% else %>
8
- desc '<%= desc %>'
11
+ desc '<%= desc %>'
9
12
  <% end %>
10
- command '<%= group['name'].gsub(".", "_") %>' do |g|
13
+ command '<%= group['name'].gsub(".", "_") %>' do |g|
11
14
  <% names.sort.each_with_index do |(name, data), index| %>
12
15
  <% if index > 0 %>
13
16
 
@@ -15,22 +18,25 @@ command '<%= group['name'].gsub(".", "_") %>' do |g|
15
18
  <% short_desc = data["desc"].split("\n").first %>
16
19
  <% short_desc += ' (undocumented)' if data['undocumented'] %>
17
20
  <% if short_desc.include?("'") %>
18
- g.desc "<%= short_desc %>"
21
+ g.desc "<%= short_desc %>"
19
22
  <% else %>
20
- g.desc '<%= short_desc %>'
23
+ g.desc '<%= short_desc %>'
21
24
  <% end %>
22
- g.long_desc %( <%= data["desc"].split("\n").join(" ") %> )
23
- g.command '<%= name %>' do |c|
25
+ g.long_desc %( <%= data["desc"].split("\n").join(" ") %> )
26
+ g.command '<%= name %>' do |c|
24
27
  <% data["args"].each do |arg_name, arg_v| %>
25
28
  <% if arg_v["desc"].include?("'") %>
26
- c.flag '<%= arg_name %>', desc: "<%= arg_v["desc"].gsub('"', '\'') %>"
29
+ c.flag '<%= arg_name %>', desc: "<%= arg_v["desc"].gsub('"', '\'') %>"
27
30
  <% else %>
28
- c.flag '<%= arg_name %>', desc: '<%= arg_v["desc"] %>'
31
+ c.flag '<%= arg_name %>', desc: '<%= arg_v["desc"] %>'
29
32
  <% end %>
30
33
  <% end %>
31
- c.action do |_global_options, options, _args|
32
- puts JSON.dump($client.<%=group['name'].gsub(".", "_") %>_<%= name %>(options))
34
+ c.action do |_global_options, options, _args|
35
+ puts JSON.dump(@client.<%=group['name'].gsub(".", "_") %>_<%= name %>(options))
36
+ end
37
+ end
38
+ <% end %>
39
+ end
33
40
  end
34
41
  end
35
- <% end %>
36
42
  end
data/lib/tasks/web.rake CHANGED
@@ -84,12 +84,6 @@ namespace :slack do
84
84
  endpoints_template.result(files: data.keys.map { |key| key.tr('.', '_') })
85
85
  )
86
86
 
87
- commands_template = Erubis::Eruby.new(File.read('lib/slack/web/api/templates/commands.erb'))
88
- File.write(
89
- 'bin/commands.rb',
90
- commands_template.result(files: data.keys.map { |key| key.tr('.', '_') })
91
- )
92
-
93
87
  errors_template = Erubis::Eruby.new(File.read('lib/slack/web/api/templates/errors.erb'))
94
88
  errors = data.values.map do |names|
95
89
  names.values.map do |d|
@@ -22,6 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency 'faraday-multipart'
23
23
  s.add_dependency 'gli'
24
24
  s.add_dependency 'hashie'
25
- s.add_dependency 'websocket-driver'
26
25
  s.metadata['rubygems_mfa_required'] = 'true'
27
26
  end
@@ -10,11 +10,34 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
10
10
  expect { client.admin_conversations_archive }.to raise_error ArgumentError, /Required arguments :channel_id missing/
11
11
  end
12
12
  end
13
+ context 'admin.conversations_bulkArchive' do
14
+ it 'requires channel_ids' do
15
+ expect { client.admin_conversations_bulkArchive }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
16
+ end
17
+ end
18
+ context 'admin.conversations_bulkDelete' do
19
+ it 'requires channel_ids' do
20
+ expect { client.admin_conversations_bulkDelete }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
21
+ end
22
+ end
23
+ context 'admin.conversations_bulkMove' do
24
+ it 'requires channel_ids' do
25
+ expect { client.admin_conversations_bulkMove(target_team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
26
+ end
27
+ it 'requires target_team_id' do
28
+ expect { client.admin_conversations_bulkMove(channel_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :target_team_id missing/
29
+ end
30
+ end
13
31
  context 'admin.conversations_convertToPrivate' do
14
32
  it 'requires channel_id' do
15
33
  expect { client.admin_conversations_convertToPrivate }.to raise_error ArgumentError, /Required arguments :channel_id missing/
16
34
  end
17
35
  end
36
+ context 'admin.conversations_convertToPublic' do
37
+ it 'requires channel_id' do
38
+ expect { client.admin_conversations_convertToPublic }.to raise_error ArgumentError, /Required arguments :channel_id missing/
39
+ end
40
+ end
18
41
  context 'admin.conversations_create' do
19
42
  it 'requires is_private' do
20
43
  expect { client.admin_conversations_create(name: %q[]) }.to raise_error ArgumentError, /Required arguments :is_private missing/
@@ -56,6 +79,14 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
56
79
  expect { client.admin_conversations_invite(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
57
80
  end
58
81
  end
82
+ context 'admin.conversations_lookup' do
83
+ it 'requires last_message_activity_before' do
84
+ expect { client.admin_conversations_lookup(team_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :last_message_activity_before missing/
85
+ end
86
+ it 'requires team_ids' do
87
+ expect { client.admin_conversations_lookup(last_message_activity_before: %q[]) }.to raise_error ArgumentError, /Required arguments :team_ids missing/
88
+ end
89
+ end
59
90
  context 'admin.conversations_removeCustomRetention' do
60
91
  it 'requires channel_id' do
61
92
  expect { client.admin_conversations_removeCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ require 'spec_helper'
5
+
6
+ RSpec.describe Slack::Web::Api::Endpoints::AdminRoles do
7
+ let(:client) { Slack::Web::Client.new }
8
+ context 'admin.roles_addAssignments' do
9
+ it 'requires entity_ids' do
10
+ expect { client.admin_roles_addAssignments(role_id: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
11
+ end
12
+ it 'requires role_id' do
13
+ expect { client.admin_roles_addAssignments(entity_ids: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :role_id missing/
14
+ end
15
+ it 'requires user_ids' do
16
+ expect { client.admin_roles_addAssignments(entity_ids: %q[], role_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
17
+ end
18
+ end
19
+ context 'admin.roles_removeAssignments' do
20
+ it 'requires entity_ids' do
21
+ expect { client.admin_roles_removeAssignments(role_id: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
22
+ end
23
+ it 'requires role_id' do
24
+ expect { client.admin_roles_removeAssignments(entity_ids: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :role_id missing/
25
+ end
26
+ it 'requires user_ids' do
27
+ expect { client.admin_roles_removeAssignments(entity_ids: %q[], role_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ require 'spec_helper'
5
+
6
+ RSpec.describe Slack::Web::Api::Endpoints::FunctionsWorkflowsStepsResponses do
7
+ let(:client) { Slack::Web::Client.new }
8
+ context 'functions.workflows.steps.responses_export' do
9
+ it 'requires step_id' do
10
+ expect { client.functions_workflows_steps_responses_export }.to raise_error ArgumentError, /Required arguments :step_id missing/
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ require 'spec_helper'
5
+
6
+ RSpec.describe Slack::Web::Api::Endpoints::FunctionsWorkflowsSteps do
7
+ let(:client) { Slack::Web::Client.new }
8
+ context 'functions.workflows.steps_list' do
9
+ it 'requires function_id' do
10
+ expect { client.functions_workflows_steps_list }.to raise_error ArgumentError, /Required arguments :function_id missing/
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-19 00:00:00.000000000 Z
11
+ date: 2023-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: websocket-driver
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  description:
98
84
  email: dblock@dblock.org
99
85
  executables:
@@ -121,8 +107,8 @@ files:
121
107
  - README.md
122
108
  - RELEASING.md
123
109
  - Rakefile
110
+ - SECURITY.md
124
111
  - UPGRADING.md
125
- - bin/commands.rb
126
112
  - bin/commands/admin_analytics.rb
127
113
  - bin/commands/admin_apps.rb
128
114
  - bin/commands/admin_apps_approved.rb
@@ -138,6 +124,7 @@ files:
138
124
  - bin/commands/admin_inviteRequests.rb
139
125
  - bin/commands/admin_inviteRequests_approved.rb
140
126
  - bin/commands/admin_inviteRequests_denied.rb
127
+ - bin/commands/admin_roles.rb
141
128
  - bin/commands/admin_teams.rb
142
129
  - bin/commands/admin_teams_admins.rb
143
130
  - bin/commands/admin_teams_owners.rb
@@ -166,6 +153,8 @@ files:
166
153
  - bin/commands/files.rb
167
154
  - bin/commands/files_comments.rb
168
155
  - bin/commands/files_remote.rb
156
+ - bin/commands/functions_workflows_steps.rb
157
+ - bin/commands/functions_workflows_steps_responses.rb
169
158
  - bin/commands/migration.rb
170
159
  - bin/commands/oauth.rb
171
160
  - bin/commands/oauth_v2.rb
@@ -249,6 +238,7 @@ files:
249
238
  - lib/slack/web/api/endpoints/admin_inviteRequests.rb
250
239
  - lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb
251
240
  - lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb
241
+ - lib/slack/web/api/endpoints/admin_roles.rb
252
242
  - lib/slack/web/api/endpoints/admin_teams.rb
253
243
  - lib/slack/web/api/endpoints/admin_teams_admins.rb
254
244
  - lib/slack/web/api/endpoints/admin_teams_owners.rb
@@ -277,6 +267,8 @@ files:
277
267
  - lib/slack/web/api/endpoints/files.rb
278
268
  - lib/slack/web/api/endpoints/files_comments.rb
279
269
  - lib/slack/web/api/endpoints/files_remote.rb
270
+ - lib/slack/web/api/endpoints/functions_workflows_steps.rb
271
+ - lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb
280
272
  - lib/slack/web/api/endpoints/migration.rb
281
273
  - lib/slack/web/api/endpoints/oauth.rb
282
274
  - lib/slack/web/api/endpoints/oauth_v2.rb
@@ -318,7 +310,6 @@ files:
318
310
  - lib/slack/web/api/schema/group.json
319
311
  - lib/slack/web/api/schema/method.json
320
312
  - lib/slack/web/api/templates/command.erb
321
- - lib/slack/web/api/templates/commands.erb
322
313
  - lib/slack/web/api/templates/endpoints.erb
323
314
  - lib/slack/web/api/templates/errors.erb
324
315
  - lib/slack/web/api/templates/method.erb
@@ -388,6 +379,7 @@ files:
388
379
  - spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb
389
380
  - spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb
390
381
  - spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb
382
+ - spec/slack/web/api/endpoints/admin_roles_spec.rb
391
383
  - spec/slack/web/api/endpoints/admin_teams_admins_spec.rb
392
384
  - spec/slack/web/api/endpoints/admin_teams_owners_spec.rb
393
385
  - spec/slack/web/api/endpoints/admin_teams_settings_spec.rb
@@ -418,6 +410,8 @@ files:
418
410
  - spec/slack/web/api/endpoints/files_comments_spec.rb
419
411
  - spec/slack/web/api/endpoints/files_remote_spec.rb
420
412
  - spec/slack/web/api/endpoints/files_spec.rb
413
+ - spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb
414
+ - spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb
421
415
  - spec/slack/web/api/endpoints/migration_spec.rb
422
416
  - spec/slack/web/api/endpoints/oauth_spec.rb
423
417
  - spec/slack/web/api/endpoints/oauth_v2_spec.rb
@@ -476,7 +470,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
476
470
  - !ruby/object:Gem::Version
477
471
  version: 1.3.6
478
472
  requirements: []
479
- rubygems_version: 3.3.23
473
+ rubygems_version: 3.1.6
480
474
  signing_key:
481
475
  specification_version: 4
482
476
  summary: Slack Web and RealTime API client.