feat(web-api): regenerate response types from latest samples - #2696
Conversation
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 detectedLatest commit: 1bcca28 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
🌲 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.getExpirationchat.stopStreamworkflows.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; |
There was a problem hiding this comment.
👾 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.
| pushd packages/web-api | ||
| npm i |
There was a problem hiding this comment.
🪓 note: This is removed with a monorepo setup towards linting!
There was a problem hiding this comment.
📝 note: Responses to workflows.step.* are included to mirror logs upstream but these methods are not active at this time.
There was a problem hiding this comment.
🗣️ note: We should include this change with #2451!
| ///////////////////////////////////////////////////////////////////////////////////////// | ||
| // // | ||
| // !!! 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. // | ||
| // // | ||
| ///////////////////////////////////////////////////////////////////////////////////////// |
There was a problem hiding this comment.
🤖 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; |
There was a problem hiding this comment.
💾 note: This is moved into alphabetical order.
| needed?: string; | ||
| ok?: boolean; | ||
| provided?: string; | ||
| job_id?: string; |
There was a problem hiding this comment.
🧮 note: This is moved to alphabetical orderings.
| }[]; | ||
| }[]; | ||
| error?: string; | ||
| invalid_channel_ids?: string[]; |
There was a problem hiding this comment.
👁️🗨️ 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; |
There was a problem hiding this comment.
🪬 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'; | |||
There was a problem hiding this comment.
🪓 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.
Summary
This pull request regenerates the Web API response types from the current
java-slack-sdksamples, picking up newly-returned optional properties.packages/web-api/src/types/response/viascripts/generate-web-api-types.sh.warningon many responses,Channel.propertiesonconversations.info) and a new response type foradmin.users.getExpiration. All additions are optional, so existing consumer code continues to type-check.npm run lint:fixfrom insidepackages/web-api, but that package has nolint/lint:fixscript 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 runsnpm run lint:fixfrom 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/tabzshape onconversations.infofrom a typo'd key in the source sample. Left in for now — the real fix belongs upstream in thejava-slack-sdkjson-logs/samples, not a hand-edit here. Flagging for a follow-up.Draft: opening for review of the generated diff before marking ready.
Testing
./scripts/generate-web-api-types.shand confirm it completes end-to-end (including thelint:fixstep) without aMissing scripterror.ConversationsInfoResponse.ts) against the liveconversations.inforesponse to confirm the added optional fields match what the API returns.