fix(cli): add defaultValue overloads and typed key unions to typegen output#27
Merged
olamide226 merged 2 commits intomainfrom Mar 14, 2026
Merged
fix(cli): add defaultValue overloads and typed key unions to typegen output#27olamide226 merged 2 commits intomainfrom
olamide226 merged 2 commits intomainfrom
Conversation
…output The generated .d.ts was missing the defaultValue overload signatures for get() in both the REP interface and standalone exports, and standalone get()/getSecure() used key: string instead of the typed key union. Now fully mirrors the SDK's actual overload signatures per §5.2.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CLI’s TypeScript typegen output so generated declarations better match the SDK’s get() overload behavior and provide typed key unions for standalone exports.
Changes:
- Emit both
get()overload signatures in the generatedREPinterface sodefaultValuenarrows the return type tostring. - Generate standalone exported
get()overloads using the typed public key union (instead ofkey: string). - Generate standalone exported
getSecure()using the typed sensitive key union (instead ofkey: string).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ict key enforcement note
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
get()in theREPinterface now emits both overload signatures (defaultValue: string→string,defaultValue?: undefined→string | undefined), matching the SDK's actual implementationget()gains the same two overloads with the typed public key union (was incorrectlykey: string)getSecure()now uses the typed sensitive key union instead ofkey: stringWhy
The SDK declares
get()with two overloads (§5.2) so callers get a narrowedstringreturn type when they pass a default value. The typegen was silently dropping both overloads, meaning consumers lost the type narrowing and got no autocomplete on key names for the standalone exports.Test plan
rep typegenagainst a manifest with public + sensitive vars and verify the generated.d.tsincludes bothget()overloads with the typed key unionrep.get('KEY', 'fallback')resolves tostring(notstring | undefined) in a consuming projectrep.get('KEY')still resolves tostring | undefinedget()orgetSecure()is a TypeScript error