Skip to content

feat(web-api): add highlight_type to files.completeUploadExternal and filesUploadV2#2594

Open
zimeg wants to merge 5 commits into
mainfrom
zimeg-feat-web-api-files-highlight
Open

feat(web-api): add highlight_type to files.completeUploadExternal and filesUploadV2#2594
zimeg wants to merge 5 commits into
mainfrom
zimeg-feat-web-api-files-highlight

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented May 13, 2026

Summary

This pull request adds highlight_type support to files.completeUploadExternal and the filesUploadV2 method.

The highlight_type parameter allows specifying the syntax highlighting type for snippet uploads (e.g. python, javascript), enabling optimistic rendering of syntax highlighting before the async upload processing job completes.

Per the webapp implementation, highlight_type is a per-file property sent inside the files array of files.completeUploadExternal, not a top-level parameter.

Changes

  • Added highlight_type to the FileUploadComplete interface (per-file in the files array)
  • Added highlight_type to FileUploadV2 so it can be specified when using filesUploadV2
  • Updated getAllFileUploadsToComplete to pass highlight_type through to each file object

Usage

import { LogLevel, WebClient } from '@slack/web-api';

const client = new WebClient(process.env.SLACK_BOT_TOKEN, { logLevel: LogLevel.DEBUG });

await client.filesUploadV2({
  channel_id: 'C0123456789',
  content: 'console.log("Hello!");',
  filename: 'example.js',
  title: 'JavaScript Snippet',
  highlight_type: 'javascript',
  initial_comment: 'Uploaded with highlight_type for optimistic rendering',
});

Requirements

… filesUploadV2

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: 37f8dfa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/web-api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.51%. Comparing base (963f9b0) to head (37f8dfa).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2594      +/-   ##
==========================================
- Coverage   87.52%   87.51%   -0.01%     
==========================================
  Files          62       62              
  Lines       10228    10230       +2     
  Branches      418      419       +1     
==========================================
+ Hits         8952     8953       +1     
- Misses       1254     1255       +1     
  Partials       22       22              
Flag Coverage Δ
cli-hooks 87.51% <100.00%> (-0.01%) ⬇️
cli-test 87.51% <100.00%> (-0.01%) ⬇️
logger 87.51% <100.00%> (-0.01%) ⬇️
oauth 87.51% <100.00%> (-0.01%) ⬇️
socket-mode 87.51% <100.00%> (-0.01%) ⬇️
web-api 87.51% <100.00%> (-0.01%) ⬇️
webhook 87.51% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zimeg zimeg self-assigned this May 13, 2026
@zimeg zimeg added pkg:web-api applies to `@slack/web-api` enhancement M-T: A feature request for new functionality labels May 13, 2026
@zimeg zimeg added this to the web-api@7.x milestone May 13, 2026
@zimeg zimeg modified the milestones: web-api@7.x, web-api@next May 13, 2026
@zimeg zimeg marked this pull request as ready for review May 13, 2026 08:15
@zimeg zimeg requested a review from a team as a code owner May 13, 2026 08:15
Copy link
Copy Markdown
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise 🙏 thanks for working on this 💯

NOTE: I think this might be a minor rather then a patch since it introduces support for new functionality 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants