fix: correct TLS type and add missing 'text' search property#327
Merged
andris9 merged 1 commit intopostalsys:masterfrom Jan 8, 2026
Merged
Conversation
The 'text' search parameter is documented in the official ImapFlow documentation (https://imapflow.com/docs/guides/searching) but was missing from the TypeScript type definitions. This allows users to search across both headers and body content without requiring type assertions. Fixes type safety when using: await client.search({ text: 'query' }, { uid: true });
andris9
approved these changes
Jan 8, 2026
Collaborator
andris9
left a comment
There was a problem hiding this comment.
The package-lock changes are unneeded, and these will get overwritten anyway so the changes are irrelevant. Otherwise LGTM
Contributor
Author
|
You're right, sorry about that, it slipped into my commit! Anyway, thanks for your prompt merge. Switching from |
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
This PR fixes two TypeScript definition issues:
TlsOptions(server-side) instead ofConnectionOptions(client-side), preventing use of client-specific options likecheckServerIdentitytextsearch: Thetextsearch parameter is documented but missing fromSearchObjectTypeScript definitionsProblem 1: Wrong TLS Type
ImapFlow is a client that connects to IMAP servers, but it was using
TlsOptionswhich is the server-side interface from Node'stlsmodule.Current (incorrect):
Impact: Users cannot use essential client TLS options without type errors:
checkServerIdentity- Custom hostname validationservername- SNI (Server Name Indication)session- Session resumptionminDHSize- Minimum DH parameter sizeCurrent workaround needed:
Problem 2: Missing
textSearchThe
textsearch parameter is documented in the ImapFlow search guide but missing fromSearchObject:Current workaround needed:
Solution
TlsOptions→ConnectionOptionsfor correct client-side TLS typingtext?: stringtoSearchObjectinterface with proper JSDocAfter This PR
Users can use proper typing without workarounds:
Testing
tlsmodule type definitionsReferences
@types/nodedefinitions confirmConnectionOptionsis client-side