feat(sandbox): type and verify default templates - #456
Merged
Conversation
Expose the existing default-template listing as TemplateInfo[] and add focused, live, and example coverage with safe read-only defaults.
miclle
marked this pull request as ready for review
July 28, 2026 09:14
Add a dedicated default-template response type and assert both element and build-status types to prevent any regressions.
This comment has been minimized.
This comment has been minimized.
Review Complete
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #456 +/- ##
==========================================
- Coverage 93.41% 93.41% -0.01%
==========================================
Files 14 14
Lines 2006 2050 +44
==========================================
+ Hits 1874 1915 +41
- Misses 132 135 +3 🚀 New features to boost your workflow:
|
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
SandboxClient.listDefaultTemplates()asPromise<TemplateInfo[]>.env-backed integration commandsWhy
The runtime
GET /default-templateswrapper already existed, but its public TypeScript contract still returnedanyand the behavior lacked focused error-path and live read-only validation. This aligns the Node.js SDK surface and verification with qiniu/go-sdk#230.Validation
npm run test:sandbox:default-templates— 2 passingnpm run test:sandbox:integration:default-templates— 1 passing, 8 live templates from the root.envQINIU_SANDBOX_TEMPLATE_MUTATION_EXAMPLE=false node examples/sandbox_templates.js— live read-only example passednpm run test:sandbox— 124 passingnpm run check-typenode --check examples/sandbox_templates.jsgit diff --checknpm pack --dry-run --json