Skip to content

feat(sdk): add support for access grants and share tokens#148

Merged
santi698 merged 2 commits into
mainfrom
tssdk-62-access-grants-share-tokens
Jul 23, 2026
Merged

feat(sdk): add support for access grants and share tokens#148
santi698 merged 2 commits into
mainfrom
tssdk-62-access-grants-share-tokens

Conversation

@santi698

@santi698 santi698 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements TSSDK-62: SDK methods and CLI commands for managing access grants and share tokens, enabling users to share runs/resources with other users or organizations.

Maps to the /v1/access/grants and /v1/access/share-tokens endpoints (already present in the vendored OpenAPI spec / generated client).

Changes

SDK (@aignostics/sdk)

  • createGrant, listGrants, getGrant, revokeGrant
  • createShareToken, listShareTokens, getShareToken, revokeShareToken
  • Mock factories/handlers for all test scenarios (success, empty, not found, validation error, server error, network error)
  • Unit tests for all new methods

CLI (@aignostics/cli)

  • New grants create/list/get/revoke commands
  • New share-tokens create/list/get/revoke commands
  • Unit tests for the CLI functions and yargs command wiring
  • README usage examples

Testing

  • npm run lint — passes
  • npm run build — passes
  • npm run test — all tests pass (SDK 98.88% coverage, CLI 98.22% coverage)

Notes

  • Includes a separate chore: regenerate ATTRIBUTIONS.md commit — this was pre-existing drift on main, auto-regenerated by the pre-commit hook and unrelated to this feature.

@santi698
santi698 force-pushed the tssdk-62-access-grants-share-tokens branch from 07ab91e to 0fcea8d Compare July 23, 2026 09:55
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.59432% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/cli-functions.ts 98.80% 0 Missing and 2 partials ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #148      +/-   ##
==========================================
+ Coverage   97.71%   98.11%   +0.40%     
==========================================
  Files          14       14              
  Lines        1794     2285     +491     
  Branches      251      294      +43     
==========================================
+ Hits         1753     2242     +489     
  Misses         41       41              
- Partials        0        2       +2     
Flag Coverage Δ
unittests 98.11% <99.59%> (+0.40%) ⬆️

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

Files with missing lines Coverage Δ
packages/cli/src/cli.ts 99.18% <100.00%> (+0.41%) ⬆️
packages/sdk/src/platform-sdk.ts 99.32% <100.00%> (+0.24%) ⬆️
packages/cli/src/cli-functions.ts 99.66% <98.80%> (-0.34%) ⬇️

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.

santi698 added 2 commits July 23, 2026 15:11
Add SDK methods and CLI commands for managing access grants and
share tokens (grants create/list/get/revoke, share-tokens
create/list/get/revoke), enabling users to share runs/resources
with other users or organizations.

Maps to /v1/access/grants and /v1/access/share-tokens endpoints.

TSSDK-62
Pre-existing drift on main unrelated to this change; regenerated by
the pre-commit hook during development.
@santi698
santi698 force-pushed the tssdk-62-access-grants-share-tokens branch from 0fcea8d to db73e9b Compare July 23, 2026 13:11

@verascheunert verascheunert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to rebase and some checks are failing @santi698

@santi698

Copy link
Copy Markdown
Collaborator Author

You'll need to rebase and some checks are failing @santi698

Yep, I knew, it was fixed in the other branch, should work now with just a rebase

@sonarqubecloud

Copy link
Copy Markdown

@verascheunert verascheunert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@santi698
santi698 merged commit 8a57377 into main Jul 23, 2026
16 checks passed
@santi698
santi698 deleted the tssdk-62-access-grants-share-tokens branch July 23, 2026 13:27
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