feat: improve TypeScript type coverage across public SDK APIs - #416
Merged
Lakes41 merged 3 commits intoJul 28, 2026
Merged
Conversation
Contributor
|
Do resolve workflow conflicts @spartan124 |
Lakes41
enabled auto-merge (squash)
July 28, 2026 18:51
Lakes41
disabled auto-merge
July 28, 2026 18:51
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.
Improve TypeScript type coverage across public SDK APIs (Resolves #350)
Description
This PR improves the overall developer experience and type safety of the GuildPass SDK by expanding TypeScript coverage and eliminating loosely typed structures across public APIs.
Historically, certain APIs and cached factory wrappers resulted in generic
Promise<any>responses, reducing editor autocompletion and compile-time confidence. With these updates, generic inference correctly propagates through the SDK, especially around our advancedincludeMetarequest options.What changed?
GuildPassClientcached method factories (e.g.getMembership,getRoles,hasRole) to accurately infer return types using theO extends RequestOptions & { includeMeta?: boolean }generic pattern.Record<string, any>usage inContractClient.getCircuitBreakerSnapshotwith the strongly-typedUrlHealthinterface.HttpClient.get()andHttpClient.post()to cleanly map response types based on whetherincludeMetais toggled.PaginatedResultandUrlHealthfromsrc/types/index.tsso developers don't have to define ad-hoc interfaces.anyCasting: Removed unsafeanycasts inAccessServicein favor of precise type assertions leveragingSignedEnvelope<AccessCheckResult>.tests/type-coverage.test.tsto assert against expected API return types usingexpectTypeOffromvitest.Acceptance Criteria
.withCachemethods)Type of change
How to test
Review the new tests in
tests/type-coverage.test.ts. Alternatively, runningnpm run typecheckvalidates that the entire SDK aligns correctly without compiler warnings (after resolving TS2209 configuration). Consumers of the SDK will immediately see more accurate types in their IDE for cached calls onclient.membership,client.access, andclient.roles.