From 4de18e41be0e7ba6016335826649509b9757e739 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Sat, 29 Aug 2026 18:58:03 -0400 Subject: [PATCH] Add cursor argument to files.list, enabling cursor-based pagination Slack's files.list API supports cursor-based pagination via the cursor argument (in addition to legacy page/count), but this was missing from the scraped docs. Add it as a patch so slack-ruby-client can generate a paginated files_list method. This fixes slack-ruby/slack-ruby-client#299, following the same approach as https://github.com/rangerscience/slack-ruby-client (which patched files_list directly instead of going through slack-api-ref). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 1 + methods/_patches/files/files.list.json | 49 ++++++++++++++++++++++++++ methods/files/files.list.json | 6 ++++ 3 files changed, 56 insertions(+) create mode 100644 methods/_patches/files/files.list.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 744d9141..c5f24456 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog Some notable infrastructure contributions below. See [commits](commits/master) for Slack API updates. * Your contribution here. +* [#90](https://github.com/slack-ruby/slack-api-ref/pull/90): Add `cursor` argument to `files.list`, enabling cursor-based pagination - [@rangerscience](https://github.com/rangerscience), [@dblock](https://github.com/dblock). * [#89](https://github.com/slack-ruby/slack-api-ref/pull/89): Migrate AI commit message generation to Copilot CLI after GitHub Models retirement - [@dblock](https://github.com/dblock). * [#87](https://github.com/slack-ruby/slack-api-ref/pull/87): Generate AI commit summaries for automated API updates - [@dblock](https://github.com/dblock). * [#64](https://github.com/slack-ruby/slack-api-ref/pull/64): Add `arg_groups` for groups of arguments whose requirement is interdependent - [@jmanian](https://github.com/jmanian). diff --git a/methods/_patches/files/files.list.json b/methods/_patches/files/files.list.json new file mode 100644 index 00000000..7b811181 --- /dev/null +++ b/methods/_patches/files/files.list.json @@ -0,0 +1,49 @@ +{ + "args": { + "channel": { + "required": false, + "desc": "Filter files appearing in a specific channel, indicated by its ID.", + "type": "channel" + }, + "cursor": { + "required": false, + "example": "dXNlcjpVMDYxTkZUVDI=", + "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.", + "type": "string" + }, + "show_files_hidden_by_limit": { + "required": false, + "example": "true", + "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.", + "type": "boolean" + }, + "team_id": { + "required": false, + "desc": "encoded team id to list files in, required if org token is used.", + "type": "string" + }, + "ts_from": { + "required": false, + "example": "123456789", + "desc": "Filter files created after this timestamp (inclusive).", + "type": "string" + }, + "ts_to": { + "required": false, + "example": "123456789", + "desc": "Filter files created before this timestamp (inclusive).", + "type": "string" + }, + "types": { + "required": false, + "example": "images", + "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.", + "type": "string" + }, + "user": { + "required": false, + "desc": "Filter files created by a single user.", + "type": "user" + } + } +} diff --git a/methods/files/files.list.json b/methods/files/files.list.json index c9c5d4c1..483d38f8 100644 --- a/methods/files/files.list.json +++ b/methods/files/files.list.json @@ -9,6 +9,12 @@ "desc": "Filter files appearing in a specific channel, indicated by its ID.", "type": "channel" }, + "cursor": { + "required": false, + "example": "dXNlcjpVMDYxTkZUVDI=", + "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.", + "type": "string" + }, "show_files_hidden_by_limit": { "required": false, "example": "true",