Skip to content

feat(sdk): accept a share token in run, item and artifact reads - #187

Merged
tobi-ax merged 2 commits into
mainfrom
feat/TSSDK-78-share-token-run-reads
Oct 28, 2026
Merged

tobi-ax merged 2 commits into
mainfrom
feat/TSSDK-78-share-token-run-reads

Conversation

@tobi-ax

@tobi-ax tobi-ax commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Resolves TSSDK-78.

Summary

The Console needs to read a run that was shared by link (CON-647). The generated PublicApi already takes a shareToken on the four run reads, but the PlatformSDK methods built on them had no way to pass one.

getRun, listRunResults, getRunItem, downloadArtifact and downloadArtifactStream now take an optional shareToken and hand it to the generated call, which sends it as the share_token query parameter:

await sdk.getRun(runId, { shareToken });
await sdk.listRunResults(runId, { page: 1, shareToken });
await sdk.getRunItem(runId, externalId, { shareToken });
await sdk.downloadArtifact(runId, artifactId, { shareToken });
await sdk.downloadArtifactStream(runId, artifactId, { shareToken });

listRunResults already had an options object, so shareToken joins it. The other four get a new trailing options object with a default of {}. Existing call forms keep compiling and send the same requests as in 3.8.1, because the generated code only adds share_token when the value is defined.

The feat(sdk) commit makes release-please propose a minor release of @aignostics/sdk.

Testing

platform-sdk.test.ts gets a table-driven block that runs each of the five methods twice against the MSW mocks and inspects the outgoing request URL:

  • with { shareToken: 'share-token-value' }, share_token equals that value
  • without options, there is no share_token parameter at all

The five positive cases fail against the source on main. Lint, typecheck and the full SDK and CLI unit suites pass locally.

Spec

docs/specs/SPEC-SDK.md (SPEC-SDK) gets the matching changes:

  • scope lists read access to runs shared by link
  • the SWR-APP-RUN-MGMT-DETAILS and SWR-APP-RESULTS-RETRIEVE-ITEMS rows name the shareToken option
  • the interface listing shows the new signatures, including getRunItem, downloadArtifact and downloadArtifactStream, which the spec did not list before
  • 3.6.2 Authorization describes how the share token is sent, and that it ends up in request URLs and therefore in access logs

The rest of the spec (grants, share-token management, retries on downloads, line numbers in 4.3) is still behind the code and stays out of this PR.

This branch now carries a Ketryx item, so it gets new commits only, no force-pushes.

🤖 Generated with Claude Code

getRun, listRunResults, getRunItem, downloadArtifact and
downloadArtifactStream take an optional shareToken option and send it
as the share_token query parameter. Calls without the option send the
same requests as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ox-security

ox-security Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

✔ No issues found

Branch feat/TSSDK-78-share-token-run-reads → main

View scan in OX Security →

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
- Coverage   93.44%   93.42%   -0.03%     
==========================================
  Files          15       15              
  Lines        2488     2509      +21     
  Branches      296      297       +1     
==========================================
+ Hits         2325     2344      +19     
  Misses        163      163              
- Partials        0        2       +2     
Flag Coverage Δ
unittests 93.42% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/sdk/src/platform-sdk.ts 99.35% <100.00%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@tobi-ax
tobi-ax merged commit 6c1d630 into main Oct 28, 2026
16 checks passed
@tobi-ax
tobi-ax deleted the feat/TSSDK-78-share-token-run-reads branch October 28, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants