slack-ruby-client 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +2 -0
- data/.github/workflows/test.yml +6 -0
- data/.github/workflows/update_api.yml +76 -0
- data/.gitignore +1 -0
- data/.rubocop_todo.yml +17 -29
- data/CHANGELOG.md +23 -1
- data/CONTRIBUTING.md +35 -32
- data/Gemfile +2 -0
- data/README.md +123 -14
- data/bin/commands/admin_apps_activities.rb +32 -0
- data/bin/commands/admin_apps_approved.rb +1 -0
- data/bin/commands/admin_apps_config.rb +31 -0
- data/bin/commands/admin_apps_requests.rb +1 -0
- data/bin/commands/admin_apps_restricted.rb +1 -0
- data/bin/commands/admin_functions.rb +23 -0
- data/bin/commands/admin_functions_permissions.rb +31 -0
- data/bin/commands/admin_roles.rb +1 -1
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_users.rb +2 -2
- data/bin/commands/admin_workflows.rb +38 -0
- data/bin/commands/admin_workflows_collaborators.rb +31 -0
- data/bin/commands/admin_workflows_permissions.rb +21 -0
- data/bin/commands/apps_activities.rb +32 -0
- data/bin/commands/apps_auth_external.rb +32 -0
- data/bin/commands/apps_datastore.rb +70 -0
- data/bin/commands/auth_teams.rb +2 -2
- data/bin/commands/calls.rb +1 -1
- data/bin/commands/chat.rb +6 -6
- data/bin/commands/chat_scheduledMessages.rb +2 -2
- data/bin/commands/conversations.rb +3 -3
- data/bin/commands/dnd.rb +1 -1
- data/bin/commands/functions_workflows_steps.rb +2 -1
- data/bin/commands/functions_workflows_steps_responses.rb +2 -1
- data/bin/commands/reminders.rb +1 -1
- data/bin/commands/stars.rb +4 -4
- data/bin/commands/team.rb +3 -1
- data/bin/commands/users.rb +1 -1
- data/lib/slack/messages/formatting.rb +44 -0
- data/lib/slack/real_time/client.rb +14 -2
- data/lib/slack/real_time/concurrency/async.rb +4 -0
- data/lib/slack/real_time/config.rb +3 -0
- data/lib/slack/real_time/socket.rb +4 -0
- data/lib/slack/real_time/stores/starter.rb +2 -2
- data/lib/slack/real_time/stores/store.rb +2 -2
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +53 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +40 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +1 -0
- data/lib/slack/web/api/endpoints/admin_functions.rb +36 -0
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/admin_roles.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +59 -0
- data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +42 -0
- data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +26 -0
- data/lib/slack/web/api/endpoints/apps_activities.rb +54 -0
- data/lib/slack/web/api/endpoints/apps_auth_external.rb +41 -0
- data/lib/slack/web/api/endpoints/apps_datastore.rb +110 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +2 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +1 -1
- data/lib/slack/web/api/endpoints/calls.rb +1 -1
- data/lib/slack/web/api/endpoints/chat.rb +14 -45
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -2
- data/lib/slack/web/api/endpoints/conversations.rb +3 -3
- data/lib/slack/web/api/endpoints/dialog.rb +1 -6
- data/lib/slack/web/api/endpoints/dnd.rb +1 -1
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +3 -1
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +3 -1
- data/lib/slack/web/api/endpoints/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/stars.rb +2 -2
- data/lib/slack/web/api/endpoints/team.rb +12 -2
- data/lib/slack/web/api/endpoints/users.rb +1 -1
- data/lib/slack/web/api/endpoints/users_profile.rb +1 -0
- data/lib/slack/web/api/endpoints/views.rb +7 -23
- data/lib/slack/web/api/endpoints/workflows.rb +2 -0
- data/lib/slack/web/api/endpoints.rb +20 -0
- data/lib/slack/web/api/errors.rb +66 -4
- data/lib/slack/web/api/options.rb +26 -0
- data/lib/slack/web/api/patches/chat.attachments-blocks.patch +7 -55
- data/lib/slack/web/api/templates/method.erb +12 -0
- data/lib/slack/web/api/templates/method_spec.erb +40 -4
- data/lib/slack/web/client.rb +1 -0
- data/lib/slack-ruby-client.rb +1 -0
- data/lib/tasks/web.rake +2 -4
- data/slack-ruby-client.gemspec +1 -0
- data/spec/slack/messages/formatting_spec.rb +60 -0
- data/spec/slack/real_time/client_spec.rb +25 -7
- data/spec/slack/real_time/concurrency/clients/async_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +14 -10
- data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/admin_functions_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_activities_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +45 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/chat_spec.rb +62 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/dialog_spec.rb +14 -0
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +6 -0
- data/spec/slack/web/api/endpoints/users_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/views_spec.rb +65 -0
- data/spec/slack/web/api/endpoints/workflows_spec.rb +8 -0
- data/spec/slack/web/api/options_spec.rb +69 -0
- data/spec/spec_helper.rb +9 -0
- metadata +45 -5
- data/lib/slack/web/api/patches/dialog.encoded-json.patch +0 -17
- data/lib/slack/web/api/patches/views.view-json.patch +0 -55
@@ -3,6 +3,7 @@ module Slack
|
|
3
3
|
module RealTime
|
4
4
|
module Config
|
5
5
|
class NoConcurrencyError < StandardError; end
|
6
|
+
class InvalidAsyncHandlersError < StandardError; end
|
6
7
|
|
7
8
|
extend self
|
8
9
|
|
@@ -15,6 +16,7 @@ module Slack
|
|
15
16
|
store_class
|
16
17
|
store_options
|
17
18
|
logger
|
19
|
+
async_handlers
|
18
20
|
].freeze
|
19
21
|
|
20
22
|
attr_accessor(*Config::ATTRIBUTES - [:concurrency])
|
@@ -29,6 +31,7 @@ module Slack
|
|
29
31
|
self.store_class = Slack::RealTime::Stores::Starter
|
30
32
|
self.store_options = {}
|
31
33
|
self.logger = nil
|
34
|
+
self.async_handlers = :none
|
32
35
|
end
|
33
36
|
|
34
37
|
def concurrency
|
@@ -63,6 +63,10 @@ module Slack
|
|
63
63
|
raise NotImplementedError, "Expected #{self.class} to implement #{__method__}."
|
64
64
|
end
|
65
65
|
|
66
|
+
def run_async(&_block)
|
67
|
+
raise NotImplementedError, "Expected #{self.class} to implement #{__method__}."
|
68
|
+
end
|
69
|
+
|
66
70
|
def time_since_last_message
|
67
71
|
return 0 unless @last_message_at
|
68
72
|
|
@@ -309,12 +309,12 @@ module Slack
|
|
309
309
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/shared_channel_invite_received.json
|
310
310
|
# on :shared_channel_invite_received do |data|
|
311
311
|
|
312
|
-
# A member has starred an item.
|
312
|
+
# A member has saved an item for later or starred an item.
|
313
313
|
# @see https://api.slack.com/events/star_added
|
314
314
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_added.json
|
315
315
|
# on :star_added do |data|
|
316
316
|
|
317
|
-
# A member removed
|
317
|
+
# A member has removed an item saved for later or starred an item.
|
318
318
|
# @see https://api.slack.com/events/star_removed
|
319
319
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_removed.json
|
320
320
|
# on :star_removed do |data|
|
@@ -495,12 +495,12 @@ module Slack
|
|
495
495
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/shared_channel_invite_received.json
|
496
496
|
# on :shared_channel_invite_received do |data|
|
497
497
|
|
498
|
-
# A member has starred an item.
|
498
|
+
# A member has saved an item for later or starred an item.
|
499
499
|
# @see https://api.slack.com/events/star_added
|
500
500
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_added.json
|
501
501
|
# on :star_added do |data|
|
502
502
|
|
503
|
-
# A member removed
|
503
|
+
# A member has removed an item saved for later or starred an item.
|
504
504
|
# @see https://api.slack.com/events/star_removed
|
505
505
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_removed.json
|
506
506
|
# on :star_removed do |data|
|
data/lib/slack/version.rb
CHANGED
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminAppsActivities
|
9
|
+
#
|
10
|
+
# Get logs for a specified team/org
|
11
|
+
#
|
12
|
+
# @option options [Object] :app_id
|
13
|
+
# The ID of the app to get activities from.
|
14
|
+
# @option options [string] :component_id
|
15
|
+
# The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows.
|
16
|
+
# @option options [string] :component_type
|
17
|
+
# The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables').
|
18
|
+
# @option options [string] :cursor
|
19
|
+
# Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail.
|
20
|
+
# @option options [integer] :limit
|
21
|
+
# The maximum number of items to return.
|
22
|
+
# @option options [string] :log_event_type
|
23
|
+
# The event type of log events to be returned.
|
24
|
+
# @option options [integer] :max_date_created
|
25
|
+
# The latest timestamp of the log to retrieve (epoch microseconds).
|
26
|
+
# @option options [integer] :min_date_created
|
27
|
+
# The earliest timestamp of the log to retrieve (epoch microseconds).
|
28
|
+
# @option options [string] :min_log_level
|
29
|
+
# The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal').
|
30
|
+
# @option options [string] :sort_direction
|
31
|
+
# The direction you want the data sorted by (always by timestamp).
|
32
|
+
# @option options [string] :source
|
33
|
+
# The source of log events to be returned. Acceptable values are ('slack', 'developer').
|
34
|
+
# @option options [string] :team_id
|
35
|
+
# The team who owns this log.
|
36
|
+
# @option options [string] :trace_id
|
37
|
+
# The trace ID of log events to be returned.
|
38
|
+
# @see https://api.slack.com/methods/admin.apps.activities.list
|
39
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.activities/admin.apps.activities.list.json
|
40
|
+
def admin_apps_activities_list(options = {})
|
41
|
+
if block_given?
|
42
|
+
Pagination::Cursor.new(self, :admin_apps_activities_list, options).each do |page|
|
43
|
+
yield page
|
44
|
+
end
|
45
|
+
else
|
46
|
+
post('admin.apps.activities.list', options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -9,6 +9,8 @@ module Slack
|
|
9
9
|
#
|
10
10
|
# List approved apps for an org or workspace.
|
11
11
|
#
|
12
|
+
# @option options [boolean] :certified
|
13
|
+
# Limit the results to only include certified apps. When false, no certified apps will appear in the result.
|
12
14
|
# @option options [string] :cursor
|
13
15
|
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
14
16
|
# @option options [Object] :enterprise_id
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminAppsConfig
|
9
|
+
#
|
10
|
+
# Look up the app config for connectors by their IDs
|
11
|
+
#
|
12
|
+
# @option options [array] :app_ids
|
13
|
+
# An array of app IDs to get app configs for.
|
14
|
+
# @see https://api.slack.com/methods/admin.apps.config.lookup
|
15
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.config/admin.apps.config.lookup.json
|
16
|
+
def admin_apps_config_lookup(options = {})
|
17
|
+
raise ArgumentError, 'Required arguments :app_ids missing' if options[:app_ids].nil?
|
18
|
+
post('admin.apps.config.lookup', options)
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Set the app config for a connector
|
23
|
+
#
|
24
|
+
# @option options [Object] :app_id
|
25
|
+
# The encoded app ID to set the app config for.
|
26
|
+
# @option options [object] :domain_restrictions
|
27
|
+
# Domain restrictions for the app.
|
28
|
+
# @option options [string] :workflow_auth_strategy
|
29
|
+
# The workflow auth permission.
|
30
|
+
# @see https://api.slack.com/methods/admin.apps.config.set
|
31
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.config/admin.apps.config.set.json
|
32
|
+
def admin_apps_config_set(options = {})
|
33
|
+
raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
|
34
|
+
post('admin.apps.config.set', options)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -25,6 +25,8 @@ module Slack
|
|
25
25
|
#
|
26
26
|
# List app requests for a team/workspace.
|
27
27
|
#
|
28
|
+
# @option options [boolean] :certified
|
29
|
+
# Include requests for certified apps.
|
28
30
|
# @option options [string] :cursor
|
29
31
|
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
30
32
|
# @option options [Object] :enterprise_id
|
@@ -9,6 +9,8 @@ module Slack
|
|
9
9
|
#
|
10
10
|
# List restricted apps for an org or workspace.
|
11
11
|
#
|
12
|
+
# @option options [boolean] :certified
|
13
|
+
# Limit the results to only include certified apps. When false, no certified apps will appear in the result.
|
12
14
|
# @option options [string] :cursor
|
13
15
|
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
14
16
|
# @option options [Object] :enterprise_id
|
@@ -288,6 +288,7 @@ module Slack
|
|
288
288
|
def admin_conversations_setConversationPrefs(options = {})
|
289
289
|
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
290
290
|
raise ArgumentError, 'Required arguments :prefs missing' if options[:prefs].nil?
|
291
|
+
options = encode_options_as_json(options, %i[prefs])
|
291
292
|
post('admin.conversations.setConversationPrefs', options)
|
292
293
|
end
|
293
294
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminFunctions
|
9
|
+
#
|
10
|
+
# Look up functions by a set of apps
|
11
|
+
#
|
12
|
+
# @option options [array] :app_ids
|
13
|
+
# Comma-separated array of app IDs to get functions for; max 50.
|
14
|
+
# @option options [string] :cursor
|
15
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
16
|
+
# @option options [integer] :limit
|
17
|
+
# The number of results that will be returned by the API on each invocation. Must be between 1 and 1000, both inclusive.
|
18
|
+
# @option options [Object] :team_id
|
19
|
+
# The team context to retrieve functions from.
|
20
|
+
# @see https://api.slack.com/methods/admin.functions.list
|
21
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.functions/admin.functions.list.json
|
22
|
+
def admin_functions_list(options = {})
|
23
|
+
raise ArgumentError, 'Required arguments :app_ids missing' if options[:app_ids].nil?
|
24
|
+
if block_given?
|
25
|
+
Pagination::Cursor.new(self, :admin_functions_list, options).each do |page|
|
26
|
+
yield page
|
27
|
+
end
|
28
|
+
else
|
29
|
+
post('admin.functions.list', options)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminFunctionsPermissions
|
9
|
+
#
|
10
|
+
# Lookup the visibility of multiple Slack functions and include the users if it is limited to particular named entities.
|
11
|
+
#
|
12
|
+
# @option options [array] :function_ids
|
13
|
+
# An array of function IDs to get permissions for.
|
14
|
+
# @see https://api.slack.com/methods/admin.functions.permissions.lookup
|
15
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.functions.permissions/admin.functions.permissions.lookup.json
|
16
|
+
def admin_functions_permissions_lookup(options = {})
|
17
|
+
raise ArgumentError, 'Required arguments :function_ids missing' if options[:function_ids].nil?
|
18
|
+
post('admin.functions.permissions.lookup', options)
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities
|
23
|
+
#
|
24
|
+
# @option options [string] :function_id
|
25
|
+
# The function ID to set permissions for.
|
26
|
+
# @option options [string] :visibility
|
27
|
+
# The function visibility.
|
28
|
+
# @option options [array] :user_ids
|
29
|
+
# List of user IDs to allow for named_entities visibility.
|
30
|
+
# @see https://api.slack.com/methods/admin.functions.permissions.set
|
31
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.functions.permissions/admin.functions.permissions.set.json
|
32
|
+
def admin_functions_permissions_set(options = {})
|
33
|
+
raise ArgumentError, 'Required arguments :function_id missing' if options[:function_id].nil?
|
34
|
+
raise ArgumentError, 'Required arguments :visibility missing' if options[:visibility].nil?
|
35
|
+
post('admin.functions.permissions.set', options)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -32,7 +32,7 @@ module Slack
|
|
32
32
|
# @option options [array] :entity_ids
|
33
33
|
# The entities for which the roles apply.
|
34
34
|
# @option options [integer] :limit
|
35
|
-
# The maximum number of items to return. Must be between 1 -
|
35
|
+
# The maximum number of items to return. Must be between 1 - 200 both inclusive.
|
36
36
|
# @option options [array] :role_ids
|
37
37
|
# collection of role ids to scope results by.
|
38
38
|
# @option options [string] :sort_dir
|
@@ -31,7 +31,7 @@ module Slack
|
|
31
31
|
# @option options [string] :cursor
|
32
32
|
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
33
33
|
# @option options [integer] :limit
|
34
|
-
# The maximum number of items to return. Must be
|
34
|
+
# The maximum number of items to return. Must be a positive integer no larger than 1000.
|
35
35
|
# @see https://api.slack.com/methods/admin.teams.list
|
36
36
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams/admin.teams.list.json
|
37
37
|
def admin_teams_list(options = {})
|
@@ -49,7 +49,7 @@ module Slack
|
|
49
49
|
# @option options [string] :real_name
|
50
50
|
# Full name of the user.
|
51
51
|
# @option options [boolean] :resend
|
52
|
-
# Allow this invite to be resent in the future if a user has not signed up yet. (default: false).
|
52
|
+
# Allow this invite to be resent in the future if a user has not signed up yet. Resending can only be done via the UI and has no expiration. (default: false).
|
53
53
|
# @see https://api.slack.com/methods/admin.users.invite
|
54
54
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.invite.json
|
55
55
|
def admin_users_invite(options = {})
|
@@ -114,7 +114,7 @@ module Slack
|
|
114
114
|
# Set an expiration for a guest user
|
115
115
|
#
|
116
116
|
# @option options [integer] :expiration_ts
|
117
|
-
#
|
117
|
+
# Epoch timestamp in seconds when guest account should be disabled.
|
118
118
|
# @option options [string] :user_id
|
119
119
|
# The ID of the user to set an expiration for.
|
120
120
|
# @option options [Object] :team_id
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminWorkflows
|
9
|
+
#
|
10
|
+
# Search workflows within the team or enterprise
|
11
|
+
#
|
12
|
+
# @option options [Object] :app_id
|
13
|
+
# The parent app ID for which to return workflows.
|
14
|
+
# @option options [array] :collaborator_ids
|
15
|
+
# Only include workflows by the collaborators inputted.
|
16
|
+
# @option options [string] :cursor
|
17
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
18
|
+
# @option options [integer] :limit
|
19
|
+
# The number of results that will be returned by the API on each invocation.
|
20
|
+
# @option options [boolean] :no_collaborators
|
21
|
+
# Only include workflows with no collaborators in the result; default is false.
|
22
|
+
# @option options [integer] :num_trigger_ids
|
23
|
+
# Number of trigger IDs to fetch for each workflow; default is 0.
|
24
|
+
# @option options [string] :query
|
25
|
+
# A search query to filter for workflow name or description.
|
26
|
+
# @option options [string] :sort
|
27
|
+
# The field used to sort the returned workflows.
|
28
|
+
# @option options [string] :sort_dir
|
29
|
+
# Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a).
|
30
|
+
# @option options [string] :source
|
31
|
+
# Source of workflow creation, either from code or workflow builder.
|
32
|
+
# @see https://api.slack.com/methods/admin.workflows.search
|
33
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows/admin.workflows.search.json
|
34
|
+
def admin_workflows_search(options = {})
|
35
|
+
if block_given?
|
36
|
+
Pagination::Cursor.new(self, :admin_workflows_search, options).each do |page|
|
37
|
+
yield page
|
38
|
+
end
|
39
|
+
else
|
40
|
+
post('admin.workflows.search', options)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Unpublish workflows within the team or enterprise
|
46
|
+
#
|
47
|
+
# @option options [array] :workflow_ids
|
48
|
+
# Array of workflow IDs to unpublish.
|
49
|
+
# @see https://api.slack.com/methods/admin.workflows.unpublish
|
50
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows/admin.workflows.unpublish.json
|
51
|
+
def admin_workflows_unpublish(options = {})
|
52
|
+
raise ArgumentError, 'Required arguments :workflow_ids missing' if options[:workflow_ids].nil?
|
53
|
+
post('admin.workflows.unpublish', options)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminWorkflowsCollaborators
|
9
|
+
#
|
10
|
+
# Add collaborators to workflows within the team or enterprise
|
11
|
+
#
|
12
|
+
# @option options [array] :collaborator_ids
|
13
|
+
# Array of collaborators (encoded user IDs) to add; max 50.
|
14
|
+
# @option options [array] :workflow_ids
|
15
|
+
# Array of workflow IDs to edit; max 50.
|
16
|
+
# @see https://api.slack.com/methods/admin.workflows.collaborators.add
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows.collaborators/admin.workflows.collaborators.add.json
|
18
|
+
def admin_workflows_collaborators_add(options = {})
|
19
|
+
raise ArgumentError, 'Required arguments :collaborator_ids missing' if options[:collaborator_ids].nil?
|
20
|
+
raise ArgumentError, 'Required arguments :workflow_ids missing' if options[:workflow_ids].nil?
|
21
|
+
post('admin.workflows.collaborators.add', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# Remove collaborators from workflows within the team or enterprise
|
26
|
+
#
|
27
|
+
# @option options [array] :collaborator_ids
|
28
|
+
# Array of collaborators (encoded user IDs) to remove; max 50.
|
29
|
+
# @option options [array] :workflow_ids
|
30
|
+
# Array of workflow IDs to edit; max 50.
|
31
|
+
# @see https://api.slack.com/methods/admin.workflows.collaborators.remove
|
32
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows.collaborators/admin.workflows.collaborators.remove.json
|
33
|
+
def admin_workflows_collaborators_remove(options = {})
|
34
|
+
raise ArgumentError, 'Required arguments :collaborator_ids missing' if options[:collaborator_ids].nil?
|
35
|
+
raise ArgumentError, 'Required arguments :workflow_ids missing' if options[:workflow_ids].nil?
|
36
|
+
post('admin.workflows.collaborators.remove', options)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminWorkflowsPermissions
|
9
|
+
#
|
10
|
+
# Look up the permissions for a set of workflows
|
11
|
+
#
|
12
|
+
# @option options [array] :workflow_ids
|
13
|
+
# An array of workflow IDs to look up permissions for.
|
14
|
+
# @option options [integer] :max_workflow_triggers
|
15
|
+
# Maximum number of triggers to fetch for each workflow when determining overall run permissions; max 1000.
|
16
|
+
# @see https://api.slack.com/methods/admin.workflows.permissions.lookup
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows.permissions/admin.workflows.permissions.lookup.json
|
18
|
+
def admin_workflows_permissions_lookup(options = {})
|
19
|
+
raise ArgumentError, 'Required arguments :workflow_ids missing' if options[:workflow_ids].nil?
|
20
|
+
post('admin.workflows.permissions.lookup', options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AppsActivities
|
9
|
+
#
|
10
|
+
# Get logs for a specified app
|
11
|
+
#
|
12
|
+
# @option options [Object] :app_id
|
13
|
+
# The id of the app to get activities from.
|
14
|
+
# @option options [string] :component_id
|
15
|
+
# The component id of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows.
|
16
|
+
# @option options [string] :component_type
|
17
|
+
# The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables').
|
18
|
+
# @option options [string] :cursor
|
19
|
+
# Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail.
|
20
|
+
# @option options [integer] :limit
|
21
|
+
# The maximum number of items to return.
|
22
|
+
# @option options [string] :log_event_type
|
23
|
+
# The event type of log events to be returned.
|
24
|
+
# @option options [integer] :max_date_created
|
25
|
+
# The latest timestamp of the log to retrieve (epoch microseconds).
|
26
|
+
# @option options [integer] :min_date_created
|
27
|
+
# The earliest timestamp of the log to retrieve (epoch microseconds).
|
28
|
+
# @option options [string] :min_log_level
|
29
|
+
# The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal').
|
30
|
+
# @option options [string] :sort_direction
|
31
|
+
# The direction you want the data sorted by (always by timestamp).
|
32
|
+
# @option options [string] :source
|
33
|
+
# The source of log events to be returned. Acceptable values are ('slack', 'developer').
|
34
|
+
# @option options [string] :team_id
|
35
|
+
# The team who owns this log.
|
36
|
+
# @option options [string] :trace_id
|
37
|
+
# The trace id of log events to be returned.
|
38
|
+
# @see https://api.slack.com/methods/apps.activities.list
|
39
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.activities/apps.activities.list.json
|
40
|
+
def apps_activities_list(options = {})
|
41
|
+
raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
|
42
|
+
if block_given?
|
43
|
+
Pagination::Cursor.new(self, :apps_activities_list, options).each do |page|
|
44
|
+
yield page
|
45
|
+
end
|
46
|
+
else
|
47
|
+
post('apps.activities.list', options)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AppsAuthExternal
|
9
|
+
#
|
10
|
+
# Delete external auth tokens only on the Slack side
|
11
|
+
#
|
12
|
+
# @option options [string] :app_id
|
13
|
+
# The id of the app whose tokens you want to delete.
|
14
|
+
# @option options [string] :external_token_id
|
15
|
+
# The id of the token that you want to delete.
|
16
|
+
# @option options [string] :provider_key
|
17
|
+
# The provider key of the provider whose tokens you want to delete.
|
18
|
+
# @see https://api.slack.com/methods/apps.auth.external.delete
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.delete.json
|
20
|
+
def apps_auth_external_delete(options = {})
|
21
|
+
post('apps.auth.external.delete', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# Get the access token for the provided token ID
|
26
|
+
#
|
27
|
+
# @option options [string] :external_token_id
|
28
|
+
# The id of the token you want to get the token for.
|
29
|
+
# @option options [boolean] :force_refresh
|
30
|
+
# Always refresh existing token before returning even when the token has not expired.
|
31
|
+
# @see https://api.slack.com/methods/apps.auth.external.get
|
32
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.get.json
|
33
|
+
def apps_auth_external_get(options = {})
|
34
|
+
raise ArgumentError, 'Required arguments :external_token_id missing' if options[:external_token_id].nil?
|
35
|
+
post('apps.auth.external.get', options)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|