Skip to content

feat(web-api): regenerate response types from latest samples - #2696

Draft
zimeg wants to merge 1 commit into
mainfrom
eden/regen-web-api-response-types
Draft

feat(web-api): regenerate response types from latest samples#2696
zimeg wants to merge 1 commit into
mainfrom
eden/regen-web-api-response-types

Conversation

@zimeg

@zimeg zimeg commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

This pull request regenerates the Web API response types from the current java-slack-sdk samples, picking up newly-returned optional properties.

  • Regenerates packages/web-api/src/types/response/ via scripts/generate-web-api-types.sh.
  • Adds newly-returned optional fields (e.g. a top-level warning on many responses, Channel.properties on conversations.info) and a new response type for admin.users.getExpiration. All additions are optional, so existing consumer code continues to type-check.
  • Fixes the generator script: the final step ran npm run lint:fix from inside packages/web-api, but that package has no lint/lint:fix script since the repo moved to root-level Biome — so the script errored on every run (Missing script: "lint:fix") and left generated files un-normalized. Now runs npm run lint:fix from the repo root. With that fixed, the regen diff drops from ~330 files (mostly formatting churn) to ~180 files of real property changes.

Known artifact (not blocking): quicktype infers a bogus Tabz/tabz shape on conversations.info from a typo'd key in the source sample. Left in for now — the real fix belongs upstream in the java-slack-sdk json-logs/samples, not a hand-edit here. Flagging for a follow-up.

Draft: opening for review of the generated diff before marking ready.

Testing

  • From the repo root, run ./scripts/generate-web-api-types.sh and confirm it completes end-to-end (including the lint:fix step) without a Missing script error.
  • Spot-check a regenerated type (e.g. ConversationsInfoResponse.ts) against the live conversations.info response to confirm the added optional fields match what the API returns.

Regenerate packages/web-api/src/types/response from the current
java-slack-sdk samples, adding newly-returned optional properties to
Web API response types (e.g. top-level `warning`, `conversations.info`
`Channel.properties`) and a response type for `admin.users.getExpiration`.
All additions are optional.

Also fix scripts/generate-web-api-types.sh: the final `npm run lint:fix`
ran from packages/web-api, but that package has no lint script since the
repo moved to root-level Biome. Run `lint:fix` from the repo root so the
generator completes end-to-end and normalizes generated output.

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

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1bcca28

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

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.11%. Comparing base (1228651) to head (1bcca28).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2696   +/-   ##
=======================================
  Coverage   89.11%   89.11%           
=======================================
  Files          65       65           
  Lines       10351    10351           
  Branches      473      473           
=======================================
  Hits         9224     9224           
  Misses       1096     1096           
  Partials       31       31           
Flag Coverage Δ
cli-hooks 89.11% <ø> (ø)
cli-test 89.11% <ø> (ø)
logger 89.11% <ø> (ø)
oauth 89.11% <ø> (ø)
socket-mode 89.11% <ø> (ø)
web-api 89.11% <ø> (ø)
webhook 89.11% <ø> (ø)

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 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🌲 A few changes are in progress for this PR but I leave the following comments after a first pass and will focus on changes to particular methods:

  • admin.users.getExpiration
  • chat.stopStream
  • workflows.featured.list

The comment on slackLists is worth calling out again here and I plan to adjust the changesets to call out changed exports if it ships in a current state but I understand if this deserves more discussion 🚢

ok?: boolean;
provided?: string;
response_metadata?: ResponseMetadata;
warning?: string;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👾 note: According to agentic search 229/330 methods have "warning" added. We might continue to search for it in upstream changes but this remains true to scripting at this time.

Comment on lines -24 to -25
pushd packages/web-api
npm i

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🪓 note: This is removed with a monorepo setup towards linting!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

📝 note: Responses to workflows.step.* are included to mirror logs upstream but these methods are not active at this time.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🗣️ note: We should include this change with #2451!

Comment on lines +1 to +8
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!! DO NOT EDIT THIS FILE !!! //
// //
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
// //
/////////////////////////////////////////////////////////////////////////////////////////

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤖 note: Some responses were handwritten and are now overwritten with automated response. This is a good change for these packages.

📝 note: I'll leave comments on WIP generations that might have changed or don't include expected response variables!

provided?: string;
response_metadata?: ResponseMetadata;
status?: string;
download_url?: string;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

💾 note: This is moved into alphabetical order.

needed?: string;
ok?: boolean;
provided?: string;
job_id?: string;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🧮 note: This is moved to alphabetical orderings.

}[];
}[];
error?: string;
invalid_channel_ids?: string[];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👁️‍🗨️ note: This removed the featured_workflows attribute in earlier responses which makes me think the upstream generation tests need to be updated!

ok?: boolean;
provided?: string;
ts?: string;
message?: ChatStopStreamResponseMessage;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🪬 note: Particular details on this response aren't found in responses and might require test changes as well.

@@ -1,14 +1,69 @@
import type { WebAPICallResult } from '../../WebClient';
import type { SlackListsSchemaColumnResponse } from '../request/slackLists';

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🪓 note: We avoid importing types from requests for this method as part of the autogenerated change. I find this continues to support existing and now additional attributes but has some risk to using exports not from the top-level of the package in code.

👁️‍🗨️ note: I'll add a few more commits to remove additional request objects.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant