Fix Slack Lists message field response types#2600
Open
akmhatey-ai wants to merge 2 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: 693b837 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 |
|
Thanks for the contribution! Before we can merge this, we need @akmhatey-ai to sign the Salesforce Inc. Contributor License Agreement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2598.
Slack Lists response items reuse the same field type family as request fields. Request message fields should keep accepting message URL strings, but response items can expose
messageas either a single Slack message object or an array of message objects.This change adds a response-specific Slack Lists field union so
SlackListsItem.fieldsaccepts both response shapes whileSlackListsItemsCreateArguments.initial_fieldsstill rejects message objects for request input.Added tsd coverage for:
messagefields accepting message URL stringsmessagefields rejecting message objectsSlackListsItemsListResponseaccepting a single message objectSlackListsItemsListResponseaccepting an array of message objectsValidation:
npx @biomejs/biome check packages/web-api/src/types/request/slackLists.ts packages/web-api/test/types/methods/slacklists.test-d.tsnpm run build --workspace=packages/web-apinpm run test:types --workspace=packages/web-apinode --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/*.test.tsfrompackages/web-apiunder Windows Node: 154 tests passedgit diff --checkpassed with local CRLF warnings onlygitleaks detect --pipe --redact --verbose --no-coloron the staged diff: no leaks foundLimitation:
npm test --workspace=packages/web-apibuilds successfully, then fails in this Windows checkout because the script'sbash -cinvocation runs under WSL/Linux Node against Windows-installed esbuild binaries. I ran the equivalent package node tests directly under Windows Node instead.Requirements