From 61dfdf0743aeffa6f2352e6499f8b32cd6101fc1 Mon Sep 17 00:00:00 2001 From: Raman Varabets Date: Thu, 1 May 2025 10:05:07 +0100 Subject: [PATCH] Add files field to message_event and url_private to file type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added files field to message_event to support file attachments - Added url_private field to file type to access file content - Updated tests and API mocks to accommodate these changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- lib/api_local.ml | 1 + lib/slack.atd | 2 ++ lib_test/slack_payloads.expected | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/api_local.ml b/lib/api_local.ml index feec1ca..1067630 100644 --- a/lib/api_local.ml +++ b/lib/api_local.ml @@ -34,6 +34,7 @@ let default_files_res : Slack_t.file = groups = []; permalink = None; permalink_public = None; + url_private = None; } let default_files_upload_res : Slack_t.files_upload_res = { ok = true; file = default_files_res } diff --git a/lib/slack.atd b/lib/slack.atd index 3d47f25..fe449eb 100644 --- a/lib/slack.atd +++ b/lib/slack.atd @@ -144,6 +144,7 @@ type file = { ~groups : string list; ?permalink: string nullable; ?permalink_public: string nullable; + ?url_private: string nullable; } type files_upload_res = { @@ -515,6 +516,7 @@ type message_event = { ts: string; ?bot_id: string option; ?thread_ts: string option; + ?files: file list nullable; } type link_shared_link = { diff --git a/lib_test/slack_payloads.expected b/lib_test/slack_payloads.expected index 058ae61..30e5b9f 100644 --- a/lib_test/slack_payloads.expected +++ b/lib_test/slack_payloads.expected @@ -908,7 +908,22 @@ failed to update views: "Both external_id and view_id not found" "channel": "C049XFXK286", "user": "U04A3C2LC6N", "text": "", - "ts": "1671595066.592719" + "ts": "1671595066.592719", + "files": [ + { + "id": "F04FPJE4ES3", + "name": "-.txt", + "title": "Untitled", + "mimetype": "text/plain", + "filetype": "text", + "pretty_type": "Plain Text", + "user": "U04A3C2LC6N", + "size": 6458, + "permalink": "https://test-bot2-server.slack.com/files/SOME_FILE_URLtxt", + "permalink_public": "https://slack-files.com/SOME_FILE_URL", + "url_private": "https://files.slack.com/files-pri/SOME_FILE_URL/-.txt" + } + ] }, "event_id": "Ev04G41LD735", "event_time": 1671595066