Skip to content

feat(sdk): add listMyPolicies for the policies of the current user - #222

Merged
tobi-ax merged 1 commit into
mainfrom
feat/TSSDK-89-list-my-policies
Dec 1, 2026
Merged

tobi-ax merged 1 commit into
mainfrom
feat/TSSDK-89-list-my-policies

Conversation

@tobi-ax

@tobi-ax tobi-ax commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

PlatformSDKHttp gets listMyPolicies, a method for GET /v1/me/policies (Platform API 1.10.0 and later). The endpoint returns each entitlement policy that applies to the caller, with its value, its subject, and the used and remaining slides. HETA Studio needs the call to show slide usage (CON-758), and it reaches the Platform API only through this class.

Jira: TSSDK-89

Changes

  • packages/sdk/src/platform-sdk.ts: listMyPolicies(options?: { applicationId?: string }) on the PlatformSDK interface and on PlatformSDKHttp. It follows listGrants: same client setup, same error handling.
  • packages/sdk/src/test-utils/http-mocks.ts: a factory and handlers for the endpoint in each mock scenario.
  • packages/sdk/src/platform-sdk.test.ts: three tests. The call without options returns the policies and sends no application_id. An application ID goes out as the application_id query parameter. A 500 rejects with APIError.
  • packages/cli/src/cli-functions.spec.ts: the SDK mock lists every PlatformSDK method and is checked with satisfies PlatformSDK, so it gets the new method. The CLI gets no command for the policies.

Release

This is the first feat commit since SDK 3.9.1, so release-please will open an SDK release PR after the merge. That release also ships the regenerated client from #175, which adds artifacts_expire_at to the run types.

The commit touches one file under packages/cli, so release-please will also count it as a feature for the CLI and plan a minor CLI release.

Testing

npm run typecheck, npm run lint, npm run format:check and npm run test pass locally (SDK 143 tests, CLI 247).

🤖 Generated with Claude Code

PlatformSDKHttp gets a method for GET /v1/me/policies. It returns each
entitlement policy that applies to the caller, with its value, its
subject and the used and remaining slides. An optional application ID
limits the values to one application.

The CLI unit tests list every PlatformSDK method in their mock, so the
mock gets the new method too.

TSSDK-89

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ox-security

ox-security Bot commented Dec 1, 2026

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

✔ No issues found

Branch feat/TSSDK-89-list-my-policies → main

View scan in OX Security →

@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

@tobi-ax
tobi-ax merged commit 4485bc6 into main Dec 1, 2026
10 checks passed
@tobi-ax
tobi-ax deleted the feat/TSSDK-89-list-my-policies branch December 1, 2026 15:09
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