fix(js-sdk): forward name param and expose names in createSnapshot#1251
Draft
serhiizghama wants to merge 1 commit intoe2b-dev:mainfrom
Draft
fix(js-sdk): forward name param and expose names in createSnapshot#1251serhiizghama wants to merge 1 commit intoe2b-dev:mainfrom
serhiizghama wants to merge 1 commit intoe2b-dev:mainfrom
Conversation
|
|
@serhiizghama seems like a duplicate of #1250 |
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.
Problem
Closes #1249
The JS SDK's
createSnapshot()silently ignored anynameoption:body: {}— thenamewas never forwarded to the REST APInameoption exposed in the type signaturenamesarray from the API response was dropped and never returnedThis meant users couldn't create named snapshots (addressable as
team-slug/my-snapshot) via the SDK — they had to fall back to raw snapshot IDs.What changed
packages/js-sdk/src/sandbox/sandboxApi.tsSnapshotCreateOptsinterface (extendsSandboxApiOpts) with an optionalnamefieldSandboxApi.createSnapshot()to acceptSnapshotCreateOptsand conditionally includenamein the request bodynames?: string[]toSnapshotInfoto surface the response field (matchesschema.gen.ts)packages/js-sdk/src/sandbox/index.tsSandbox.createSnapshot()to acceptSnapshotCreateOptsinstead ofSandboxApiOptspackages/js-sdk/src/index.tsSnapshotCreateOptsfrom the public APIHow to test
The generated schema (
schema.gen.ts) already included both thenamerequest field andnamesresponse field — this PR aligns the SDK implementation with the schema.