slack-ruby-client 1.0.0 → 2.1.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/.github/workflows/integration_test.yml +45 -0
- data/.github/workflows/lint.yml +14 -0
- data/.github/workflows/pr_lint.yml +21 -0
- data/.github/workflows/test.yml +37 -0
- data/.gitignore +4 -3
- data/.rubocop.yml +6 -1
- data/.rubocop_todo.yml +88 -34
- data/.ruby-version +1 -0
- data/CHANGELOG.md +36 -0
- data/CONTRIBUTING.md +6 -5
- data/Gemfile +13 -1
- data/Gemfile.danger +6 -0
- data/README.md +78 -76
- data/RELEASING.md +2 -2
- data/SECURITY.md +9 -0
- data/UPGRADING.md +28 -0
- data/bin/commands/admin_analytics.rb +16 -10
- data/bin/commands/admin_apps.rb +48 -42
- data/bin/commands/admin_apps_approved.rb +17 -11
- data/bin/commands/admin_apps_requests.rb +28 -11
- data/bin/commands/admin_apps_restricted.rb +17 -11
- data/bin/commands/admin_audit_anomaly_allow.rb +29 -0
- data/bin/commands/admin_auth_policy.rb +37 -31
- data/bin/commands/admin_barriers.rb +44 -38
- data/bin/commands/admin_conversations.rb +221 -163
- data/bin/commands/admin_conversations_ekm.rb +17 -11
- data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
- data/bin/commands/admin_emoji.rb +50 -44
- data/bin/commands/admin_inviteRequests.rb +34 -28
- data/bin/commands/admin_inviteRequests_approved.rb +16 -10
- data/bin/commands/admin_inviteRequests_denied.rb +16 -10
- data/bin/commands/admin_roles.rb +46 -0
- data/bin/commands/admin_teams.rb +26 -20
- data/bin/commands/admin_teams_admins.rb +16 -10
- data/bin/commands/admin_teams_owners.rb +16 -10
- data/bin/commands/admin_teams_settings.rb +59 -53
- data/bin/commands/admin_usergroups.rb +45 -39
- data/bin/commands/admin_users.rb +91 -85
- data/bin/commands/admin_users_session.rb +72 -66
- data/bin/commands/admin_users_unsupportedVersions.rb +21 -0
- data/bin/commands/api.rb +14 -8
- data/bin/commands/apps.rb +15 -9
- data/bin/commands/apps_connections.rb +13 -7
- data/bin/commands/apps_event_authorizations.rb +16 -10
- data/bin/commands/apps_manifest.rb +48 -41
- data/bin/commands/auth.rb +21 -15
- data/bin/commands/auth_teams.rb +16 -10
- data/bin/commands/bookmarks.rb +59 -0
- data/bin/commands/bots.rb +15 -9
- data/bin/commands/calls.rb +49 -43
- data/bin/commands/calls_participants.rb +24 -18
- data/bin/commands/chat.rb +150 -141
- data/bin/commands/chat_scheduledMessages.rb +19 -13
- data/bin/commands/conversations.rb +233 -225
- data/bin/commands/dialog.rb +15 -9
- data/bin/commands/dnd.rb +46 -40
- data/bin/commands/emoji.rb +14 -7
- data/bin/commands/files.rb +112 -83
- data/bin/commands/files_comments.rb +15 -9
- data/bin/commands/files_remote.rb +73 -67
- data/bin/commands/functions_workflows_steps.rb +22 -0
- data/bin/commands/functions_workflows_steps_responses.rb +22 -0
- data/bin/commands/migration.rb +16 -10
- data/bin/commands/oauth.rb +18 -12
- data/bin/commands/oauth_v2.rb +28 -22
- data/bin/commands/openid_connect.rb +26 -20
- data/bin/commands/pins.rb +33 -26
- data/bin/commands/reactions.rb +52 -46
- data/bin/commands/reminders.rb +53 -47
- data/bin/commands/rtm.rb +15 -24
- data/bin/commands/search.rb +43 -37
- data/bin/commands/stars.rb +38 -32
- data/bin/commands/team.rb +47 -38
- data/bin/commands/team_billing.rb +13 -7
- data/bin/commands/team_preferences.rb +13 -7
- data/bin/commands/team_profile.rb +14 -8
- data/bin/commands/tooling_tokens.rb +14 -8
- data/bin/commands/usergroups.rb +64 -58
- data/bin/commands/usergroups_users.rb +27 -21
- data/bin/commands/users.rb +111 -105
- data/bin/commands/users_admin.rb +28 -22
- data/bin/commands/users_prefs.rb +13 -7
- data/bin/commands/users_profile.rb +26 -20
- data/bin/commands/views.rb +47 -39
- data/bin/commands/workflows.rb +36 -30
- data/bin/slack +48 -43
- 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 +10 -28
- 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 +2 -2
- data/lib/slack/web/api/endpoints/admin_apps.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +16 -0
- 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 +110 -28
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_emoji.rb +9 -9
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
- 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/admin_users_unsupportedVersions.rb +25 -0
- 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 +8 -6
- data/lib/slack/web/api/endpoints/bookmarks.rb +88 -0
- 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 +37 -31
- data/lib/slack/web/api/endpoints/conversations.rb +38 -34
- 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/emoji.rb +2 -0
- data/lib/slack/web/api/endpoints/files.rb +45 -10
- 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/functions_workflows_steps.rb +28 -0
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
- 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 +5 -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/team.rb +13 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
- 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/users_profile.rb +1 -1
- 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 +12 -0
- data/lib/slack/web/api/errors.rb +146 -8
- 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/command.erb +18 -12
- data/lib/slack/web/api/templates/method.erb +1 -1
- data/lib/slack/web/config.rb +2 -2
- data/lib/slack/web/faraday/connection.rb +4 -4
- data/lib/slack/web/faraday/request.rb +2 -0
- data/lib/slack/web/faraday/response/raise_error.rb +2 -10
- data/lib/slack/web/faraday/response/wrap_error.rb +1 -1
- data/lib/slack-ruby-client.rb +2 -1
- data/lib/tasks/real_time.rake +44 -24
- data/lib/tasks/web.rake +9 -8
- data/slack-ruby-client.gemspec +5 -14
- data/spec/fixtures/slack/web/rtm_connect.yml +85 -1
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/events/config_spec.rb +2 -0
- data/spec/slack/events/request_spec.rb +5 -1
- 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 +91 -127
- 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 +30 -27
- 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} +27 -23
- 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 +5 -4
- data/spec/slack/version_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
- data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +45 -17
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +6 -2
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +33 -16
- data/spec/slack/web/api/endpoints/files_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/functions_workflows_steps_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 +11 -7
- data/spec/slack/web/client_spec.rb +39 -11
- data/spec/slack/web/faraday/response/raise_error_spec.rb +1 -1
- data/spec/support/real_time/connected_client.rb +1 -1
- data/spec/support/real_time/loaded_client.rb +120 -0
- metadata +45 -197
- data/.travis.yml +0 -29
- 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/bin/commands.rb +0 -66
- 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/lib/slack/web/api/templates/commands.erb +0 -6
- 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
data/bin/commands/dnd.rb
CHANGED
|
@@ -1,50 +1,56 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'Dnd methods.'
|
|
8
|
+
command 'dnd' do |g|
|
|
9
|
+
g.desc "Ends the current user's Do Not Disturb session immediately."
|
|
10
|
+
g.long_desc %( Ends the current user's Do Not Disturb session immediately. )
|
|
11
|
+
g.command 'endDnd' do |c|
|
|
12
|
+
c.action do |_global_options, options, _args|
|
|
13
|
+
puts JSON.dump(@client.dnd_endDnd(options))
|
|
14
|
+
end
|
|
15
|
+
end
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
g.desc "Ends the current user's snooze mode immediately."
|
|
18
|
+
g.long_desc %( Ends the current user's snooze mode immediately. )
|
|
19
|
+
g.command 'endSnooze' do |c|
|
|
20
|
+
c.action do |_global_options, options, _args|
|
|
21
|
+
puts JSON.dump(@client.dnd_endSnooze(options))
|
|
22
|
+
end
|
|
23
|
+
end
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
g.desc "Retrieves a user's current Do Not Disturb status."
|
|
26
|
+
g.long_desc %( Retrieves a user's current Do Not Disturb status. )
|
|
27
|
+
g.command 'info' do |c|
|
|
28
|
+
c.flag 'team_id', desc: 'Encoded team id where passed in user param belongs, required if org token is used. If no user param is passed, then a team which has access to the app should be passed.'
|
|
29
|
+
c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
|
|
30
|
+
c.action do |_global_options, options, _args|
|
|
31
|
+
puts JSON.dump(@client.dnd_info(options))
|
|
32
|
+
end
|
|
33
|
+
end
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
g.desc 'Turns on Do Not Disturb mode for the current user, or changes its duration.'
|
|
36
|
+
g.long_desc %( Turns on Do Not Disturb mode for the current user, or changes its duration. )
|
|
37
|
+
g.command 'setSnooze' do |c|
|
|
38
|
+
c.flag 'num_minutes', desc: 'Number of minutes, from now, to snooze until.'
|
|
39
|
+
c.action do |_global_options, options, _args|
|
|
40
|
+
puts JSON.dump(@client.dnd_setSnooze(options))
|
|
41
|
+
end
|
|
42
|
+
end
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
g.desc 'Retrieves the Do Not Disturb status for up to 50 users on a team.'
|
|
45
|
+
g.long_desc %( Retrieves the Do Not Disturb status for up to 50 users on a team. )
|
|
46
|
+
g.command 'teamInfo' do |c|
|
|
47
|
+
c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
|
|
48
|
+
c.flag 'team_id', desc: 'Encoded team id where passed in users belong, required if org token is used.'
|
|
49
|
+
c.action do |_global_options, options, _args|
|
|
50
|
+
puts JSON.dump(@client.dnd_teamInfo(options))
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
48
54
|
end
|
|
49
55
|
end
|
|
50
56
|
end
|
data/bin/commands/emoji.rb
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'Emoji methods.'
|
|
8
|
+
command 'emoji' do |g|
|
|
9
|
+
g.desc 'Lists custom emoji for a team.'
|
|
10
|
+
g.long_desc %( Lists custom emoji for a team. )
|
|
11
|
+
g.command 'list' do |c|
|
|
12
|
+
c.flag 'include_categories', desc: 'Include a list of categories for Unicode emoji and the emoji in each category.'
|
|
13
|
+
c.action do |_global_options, options, _args|
|
|
14
|
+
puts JSON.dump(@client.emoji_list(options))
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
11
18
|
end
|
|
12
19
|
end
|
|
13
20
|
end
|
data/bin/commands/files.rb
CHANGED
|
@@ -1,96 +1,125 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'Files methods.'
|
|
8
|
+
command 'files' do |g|
|
|
9
|
+
g.desc 'Finishes an upload started with files.getUploadURLExternal'
|
|
10
|
+
g.long_desc %( Finishes an upload started with files.getUploadURLExternal )
|
|
11
|
+
g.command 'completeUploadExternal' do |c|
|
|
12
|
+
c.flag 'files', desc: 'Array of file ids and their corresponding (optional) titles.'
|
|
13
|
+
c.flag 'channel_id', desc: 'Channel ID where the file will be shared. If not specified the file will be private.'
|
|
14
|
+
c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.'
|
|
15
|
+
c.flag 'thread_ts', desc: "Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead."
|
|
16
|
+
c.action do |_global_options, options, _args|
|
|
17
|
+
puts JSON.dump(@client.files_completeUploadExternal(options))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
end
|
|
24
|
-
end
|
|
21
|
+
g.desc 'Deletes a file.'
|
|
22
|
+
g.long_desc %( Deletes a file. )
|
|
23
|
+
g.command 'delete' do |c|
|
|
24
|
+
c.flag 'file', desc: 'ID of file to delete.'
|
|
25
|
+
c.action do |_global_options, options, _args|
|
|
26
|
+
puts JSON.dump(@client.files_delete(options))
|
|
27
|
+
end
|
|
28
|
+
end
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
g.desc 'Change the properties of a file (undocumented)'
|
|
31
|
+
g.long_desc %( Change the properties of a file )
|
|
32
|
+
g.command 'edit' do |c|
|
|
33
|
+
c.flag 'file', desc: 'ID of the file to be edited'
|
|
34
|
+
c.flag 'title', desc: 'New title of the file'
|
|
35
|
+
c.flag 'filetype', desc: 'New filetype of the file. See https://api.slack.com/types/file#file_types for a list of all supported types.'
|
|
36
|
+
c.action do |_global_options, options, _args|
|
|
37
|
+
puts JSON.dump(@client.files_edit(options))
|
|
38
|
+
end
|
|
39
|
+
end
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
c.action do |_global_options, options, _args|
|
|
49
|
-
puts JSON.dump($client.files_list(options))
|
|
50
|
-
end
|
|
51
|
-
end
|
|
41
|
+
g.desc 'Gets a URL for an edge external file upload'
|
|
42
|
+
g.long_desc %( Gets a URL for an edge external file upload )
|
|
43
|
+
g.command 'getUploadURLExternal' do |c|
|
|
44
|
+
c.flag 'filename', desc: 'Name of the file being uploaded.'
|
|
45
|
+
c.flag 'length', desc: 'Size in bytes of the file being uploaded.'
|
|
46
|
+
c.flag 'alt_txt', desc: 'Description of image for screen-reader.'
|
|
47
|
+
c.flag 'snippet_type', desc: 'Syntax type of the snippet being uploaded.'
|
|
48
|
+
c.action do |_global_options, options, _args|
|
|
49
|
+
puts JSON.dump(@client.files_getUploadURLExternal(options))
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
g.desc 'Gets information about a file.'
|
|
54
|
+
g.long_desc %( Gets information about a file. )
|
|
55
|
+
g.command 'info' do |c|
|
|
56
|
+
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
|
57
|
+
c.flag 'cursor', desc: "Parameter for pagination. File comments are paginated for a single file. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection of comments. See pagination for more details."
|
|
58
|
+
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
|
|
59
|
+
c.action do |_global_options, options, _args|
|
|
60
|
+
puts JSON.dump(@client.files_info(options))
|
|
61
|
+
end
|
|
62
|
+
end
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
g.desc 'List for a team, in a channel, or from a user with applied filters.'
|
|
65
|
+
g.long_desc %( List for a team, in a channel, or from a user with applied filters. )
|
|
66
|
+
g.command 'list' do |c|
|
|
67
|
+
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
|
|
68
|
+
c.flag 'show_files_hidden_by_limit', desc: 'Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.'
|
|
69
|
+
c.flag 'team_id', desc: 'encoded team id to list files in, required if org token is used.'
|
|
70
|
+
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
|
|
71
|
+
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
|
|
72
|
+
c.flag 'types', desc: 'Filter files by type (see below). You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.'
|
|
73
|
+
c.flag 'user', desc: 'Filter files created by a single user.'
|
|
74
|
+
c.action do |_global_options, options, _args|
|
|
75
|
+
puts JSON.dump(@client.files_list(options))
|
|
76
|
+
end
|
|
77
|
+
end
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
g.desc 'Revokes public/external sharing access for a file'
|
|
80
|
+
g.long_desc %( Revokes public/external sharing access for a file )
|
|
81
|
+
g.command 'revokePublicURL' do |c|
|
|
82
|
+
c.flag 'file', desc: 'File to revoke.'
|
|
83
|
+
c.action do |_global_options, options, _args|
|
|
84
|
+
puts JSON.dump(@client.files_revokePublicURL(options))
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
g.desc 'Share an existing file in a channel (undocumented)'
|
|
89
|
+
g.long_desc %( Share an existing file in a channel )
|
|
90
|
+
g.command 'share' do |c|
|
|
91
|
+
c.flag 'file', desc: 'ID of the file to be shared'
|
|
92
|
+
c.flag 'channel', desc: 'Channel to share the file in. Works with both public (channel ID) and private channels (group ID).'
|
|
93
|
+
c.action do |_global_options, options, _args|
|
|
94
|
+
puts JSON.dump(@client.files_share(options))
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
g.desc 'Enables a file for public/external sharing.'
|
|
99
|
+
g.long_desc %( Enables a file for public/external sharing. )
|
|
100
|
+
g.command 'sharedPublicURL' do |c|
|
|
101
|
+
c.flag 'file', desc: 'File to share.'
|
|
102
|
+
c.action do |_global_options, options, _args|
|
|
103
|
+
puts JSON.dump(@client.files_sharedPublicURL(options))
|
|
104
|
+
end
|
|
105
|
+
end
|
|
80
106
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
107
|
+
g.desc 'Uploads or creates a file.'
|
|
108
|
+
g.long_desc %( Uploads or creates a file. )
|
|
109
|
+
g.command 'upload' do |c|
|
|
110
|
+
c.flag 'channels', desc: 'Comma-separated list of channel names or IDs where the file will be shared.'
|
|
111
|
+
c.flag 'content', desc: 'File contents via a POST variable. If omitting this parameter, you must provide a file.'
|
|
112
|
+
c.flag 'file', desc: 'File contents via multipart/form-data. If omitting this parameter, you must submit content.'
|
|
113
|
+
c.flag 'filename', desc: 'Filename of file.'
|
|
114
|
+
c.flag 'filetype', desc: 'A file type identifier.'
|
|
115
|
+
c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.'
|
|
116
|
+
c.flag 'thread_ts', desc: "Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead."
|
|
117
|
+
c.flag 'title', desc: 'Title of file.'
|
|
118
|
+
c.action do |_global_options, options, _args|
|
|
119
|
+
puts JSON.dump(@client.files_upload(options))
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
94
123
|
end
|
|
95
124
|
end
|
|
96
125
|
end
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'FilesComments methods.'
|
|
8
|
+
command 'files_comments' do |g|
|
|
9
|
+
g.desc 'Deletes an existing comment on a file.'
|
|
10
|
+
g.long_desc %( Deletes an existing comment on a file. )
|
|
11
|
+
g.command 'delete' do |c|
|
|
12
|
+
c.flag 'file', desc: 'File to delete a comment from.'
|
|
13
|
+
c.flag 'id', desc: 'The comment to delete.'
|
|
14
|
+
c.action do |_global_options, options, _args|
|
|
15
|
+
puts JSON.dump(@client.files_comments_delete(options))
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
13
19
|
end
|
|
14
20
|
end
|
|
15
21
|
end
|
|
@@ -1,78 +1,84 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'FilesRemote methods.'
|
|
8
|
+
command 'files_remote' do |g|
|
|
9
|
+
g.desc 'Adds a file from a remote service'
|
|
10
|
+
g.long_desc %( Adds a file from a remote service )
|
|
11
|
+
g.command 'add' do |c|
|
|
12
|
+
c.flag 'external_id', desc: 'Creator defined GUID for the file.'
|
|
13
|
+
c.flag 'external_url', desc: 'URL of the remote file.'
|
|
14
|
+
c.flag 'title', desc: 'Title of the file being shared.'
|
|
15
|
+
c.flag 'filetype', desc: 'type of file.'
|
|
16
|
+
c.flag 'indexable_file_contents', desc: 'A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.'
|
|
17
|
+
c.flag 'preview_image', desc: 'Preview of the document via multipart/form-data.'
|
|
18
|
+
c.action do |_global_options, options, _args|
|
|
19
|
+
puts JSON.dump(@client.files_remote_add(options))
|
|
20
|
+
end
|
|
21
|
+
end
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
g.desc 'Retrieve information about a remote file added to Slack'
|
|
24
|
+
g.long_desc %( Retrieve information about a remote file added to Slack )
|
|
25
|
+
g.command 'info' do |c|
|
|
26
|
+
c.flag 'external_id', desc: 'Creator defined GUID for the file.'
|
|
27
|
+
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
|
28
|
+
c.action do |_global_options, options, _args|
|
|
29
|
+
puts JSON.dump(@client.files_remote_info(options))
|
|
30
|
+
end
|
|
31
|
+
end
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
g.desc 'Retrieve information about a remote file added to Slack'
|
|
34
|
+
g.long_desc %( Retrieve information about a remote file added to Slack )
|
|
35
|
+
g.command 'list' do |c|
|
|
36
|
+
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
|
|
37
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
|
|
38
|
+
c.flag 'limit', desc: 'The maximum number of items to return.'
|
|
39
|
+
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
|
|
40
|
+
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
|
|
41
|
+
c.action do |_global_options, options, _args|
|
|
42
|
+
puts JSON.dump(@client.files_remote_list(options))
|
|
43
|
+
end
|
|
44
|
+
end
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
g.desc 'Remove a remote file.'
|
|
47
|
+
g.long_desc %( Remove a remote file. )
|
|
48
|
+
g.command 'remove' do |c|
|
|
49
|
+
c.flag 'external_id', desc: 'Creator defined GUID for the file.'
|
|
50
|
+
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
|
51
|
+
c.action do |_global_options, options, _args|
|
|
52
|
+
puts JSON.dump(@client.files_remote_remove(options))
|
|
53
|
+
end
|
|
54
|
+
end
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
g.desc 'Share a remote file into a channel.'
|
|
57
|
+
g.long_desc %( Share a remote file into a channel. )
|
|
58
|
+
g.command 'share' do |c|
|
|
59
|
+
c.flag 'channels', desc: 'Comma-separated list of channel IDs where the file will be shared.'
|
|
60
|
+
c.flag 'external_id', desc: 'The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or file or both are required.'
|
|
61
|
+
c.flag 'file', desc: 'Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.'
|
|
62
|
+
c.action do |_global_options, options, _args|
|
|
63
|
+
puts JSON.dump(@client.files_remote_share(options))
|
|
64
|
+
end
|
|
65
|
+
end
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
g.desc 'Updates an existing remote file.'
|
|
68
|
+
g.long_desc %( Updates an existing remote file. )
|
|
69
|
+
g.command 'update' do |c|
|
|
70
|
+
c.flag 'external_id', desc: 'Creator defined GUID for the file.'
|
|
71
|
+
c.flag 'external_url', desc: 'URL of the remote file.'
|
|
72
|
+
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
|
73
|
+
c.flag 'filetype', desc: 'type of file.'
|
|
74
|
+
c.flag 'indexable_file_contents', desc: 'File containing contents that can be used to improve searchability for the remote file.'
|
|
75
|
+
c.flag 'preview_image', desc: 'Preview of the document via multipart/form-data.'
|
|
76
|
+
c.flag 'title', desc: 'Title of the file being shared.'
|
|
77
|
+
c.action do |_global_options, options, _args|
|
|
78
|
+
puts JSON.dump(@client.files_remote_update(options))
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
76
82
|
end
|
|
77
83
|
end
|
|
78
84
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
|
3
|
+
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'FunctionsWorkflowsSteps methods.'
|
|
8
|
+
command 'functions_workflows_steps' do |g|
|
|
9
|
+
g.desc "List the steps of a specific function of a workflow's versions"
|
|
10
|
+
g.long_desc %( List the steps of a specific function of a workflow's versions )
|
|
11
|
+
g.command 'list' do |c|
|
|
12
|
+
c.flag 'function_id', desc: '.'
|
|
13
|
+
c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.'
|
|
14
|
+
c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.'
|
|
15
|
+
c.action do |_global_options, options, _args|
|
|
16
|
+
puts JSON.dump(@client.functions_workflows_steps_list(options))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
|
3
|
+
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'FunctionsWorkflowsStepsResponses methods.'
|
|
8
|
+
command 'functions_workflows_steps_responses' do |g|
|
|
9
|
+
g.desc 'Download form responses of a workflow'
|
|
10
|
+
g.long_desc %( Download form responses of a workflow )
|
|
11
|
+
g.command 'export' do |c|
|
|
12
|
+
c.flag 'step_id', desc: '.'
|
|
13
|
+
c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.'
|
|
14
|
+
c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.'
|
|
15
|
+
c.action do |_global_options, options, _args|
|
|
16
|
+
puts JSON.dump(@client.functions_workflows_steps_responses_export(options))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/bin/commands/migration.rb
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
module Slack
|
|
5
|
+
module Cli
|
|
6
|
+
class App
|
|
7
|
+
desc 'Migration methods.'
|
|
8
|
+
command 'migration' do |g|
|
|
9
|
+
g.desc 'For Enterprise Grid workspaces, map local user IDs to global user IDs'
|
|
10
|
+
g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs )
|
|
11
|
+
g.command 'exchange' do |c|
|
|
12
|
+
c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.'
|
|
13
|
+
c.flag 'team_id', desc: 'Specify team_id starts with T in case of Org Token.'
|
|
14
|
+
c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.'
|
|
15
|
+
c.action do |_global_options, options, _args|
|
|
16
|
+
puts JSON.dump(@client.migration_exchange(options))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
14
20
|
end
|
|
15
21
|
end
|
|
16
22
|
end
|