Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2025-09-06 23:33:08 UTC using RuboCop version 1.80.2.
# on 2025-09-21 13:03:00 UTC using RuboCop version 1.80.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
# Offense count: 4
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 50
Max: 49

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Expand All @@ -20,7 +20,7 @@ Metrics/BlockLength:
# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 127
Max: 132

# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This is a maintained, machine-readable version of the Slack API Docs, generated

[Known undocumented methods and groups](https://github.com/ErikKalkoken/slackApiDoc) have been added manually.

* [methods](methods/undocumented): Undocumented methods.
* [groups](groups/undocumented): Undocumented groups.
* [methods](methods/_undocumented): Undocumented methods.
* [groups](groups/_undocumented): Undocumented groups.

### It needs an update!

Expand Down
11 changes: 11 additions & 0 deletions methods/_patches/admin/admin.users.session.invalidate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arg_groups": [
{
"args": [
"user_id"
],
"desc": "Exactly one of these arguments is required to identify the session that is to be invalidated, user_id is preferred and team_id will be deprecated and eventually removed on January 15, 2025.",
"mutually_exclusive": true
}
]
}
13 changes: 13 additions & 0 deletions methods/_patches/chat/chat.postEphemeral.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arg_groups": [
{
"args": [
"attachments",
"blocks",
"text"
],
"desc": "One of these arguments in addition to text is required to describe the content of the message. When attachments or blocks are included, text will be used as fallback text for notifications only.",
"mutually_exclusive": false
}
]
}
13 changes: 13 additions & 0 deletions methods/_patches/chat/chat.postMessage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arg_groups": [
{
"args": [
"attachments",
"blocks",
"text"
],
"desc": "One of these arguments in addition to text is required to describe the content of the message. When attachments or blocks are included, text will be used as fallback text for notifications only.",
"mutually_exclusive": false
}
]
}
13 changes: 13 additions & 0 deletions methods/_patches/chat/chat.scheduleMessage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arg_groups": [
{
"args": [
"attachments",
"blocks",
"text"
],
"desc": "One of these arguments in addition to text is required to describe the content of the message. When attachments or blocks are included, text will be used as fallback text for notifications only.",
"mutually_exclusive": false
}
]
}
13 changes: 13 additions & 0 deletions methods/_patches/chat/chat.update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arg_groups": [
{
"args": [
"attachments",
"blocks",
"text"
],
"desc": "One of these arguments in addition to text is required to describe the content of the message. When attachments or blocks are included, text will be used as fallback text for notifications only.",
"mutually_exclusive": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arg_groups": [
{
"args": [
"permission_type"
],
"desc": ".",
"mutually_exclusive": true
}
]
}
12 changes: 12 additions & 0 deletions methods/_patches/views/views.open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"arg_groups": [
{
"args": [
"trigger_id",
"interactivity_pointer"
],
"desc": "One of these arguments is required to open a view for a user.",
"mutually_exclusive": true
}
]
}
12 changes: 12 additions & 0 deletions methods/_patches/views/views.push.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"arg_groups": [
{
"args": [
"trigger_id",
"interactivity_pointer"
],
"desc": "One of these arguments is required to push a view.",
"mutually_exclusive": true
}
]
}
12 changes: 12 additions & 0 deletions methods/_patches/views/views.update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"arg_groups": [
{
"args": [
"external_id",
"view_id"
],
"desc": "Exactly one of these arguments is required to identify the view that is to be updated.",
"mutually_exclusive": true
}
]
}
3 changes: 2 additions & 1 deletion tasks/events.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ namespace :api do
task :validate do
schema = File.read('schemas/events.json')
validator = SlackApi::SpecValidator.new(schema)
Dir.glob('events/**/*.json').each do |file|
Dir.glob('events/**/*.json').grep_v(%r{/_patches\b}).each do |file|
puts file
abort "Invalid file format: #{file}" unless validator.valid?(file)
end
end
Expand Down
8 changes: 7 additions & 1 deletion tasks/lib/slack_api/methods_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def process_method(data)
errors: errors
}.merge(fields)

patch_filename = "methods/_patches/#{data['group']}/#{data['name']}.json"
if File.exist?(patch_filename)
puts "(patch) #{patch_filename}"
result.merge!(JSON.load_file(patch_filename))
end

filename = "methods/#{data['group']}/#{data['name']}.json"
FileUtils.mkdir_p("methods/#{data['group']}")
puts filename
Expand Down Expand Up @@ -93,7 +99,7 @@ def parse_args(data)
end
end

[args.sort.to_h, fields]
[args.to_h, fields]
end

def massage_type(name, arg, data = {})
Expand Down
3 changes: 2 additions & 1 deletion tasks/methods.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ namespace :api do
task :validate do
schema = File.read('schemas/methods.json')
validator = SlackApi::SpecValidator.new(schema)
Dir.glob('methods/**/*.json').each do |file|
Dir.glob('methods/**/*.json').grep_v(%r{/_patches\b}).each do |file|
puts file
abort "Invalid file format: #{file}" unless validator.valid?(file)
end
end
Expand Down
5 changes: 4 additions & 1 deletion tasks/update.rake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ namespace :api do

desc 'Delete all generated files except undocumented ones.'
task :clean_files, :dirs do |_t, args|
files = Dir["./{#{Array(args[:dirs]).join(',')}}/*"].grep_v(%r{/undocumented\b})
raise 'Missing :dirs' unless args[:dirs]

# keep _undocumented and _patches
files = Dir["./{#{Array(args[:dirs]).join(',')}}/*"].grep_v(%r{/_\w*\b})
FileUtils.rm_rf files
end
end
Expand Down