Repository navigation
feat(sdk): add listMyPolicies for the policies of the current user - #222
Merged
Merged
Conversation
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 reviewed this pull request — nothing to fix.
Branch |
|
verascheunert
approved these changes
Dec 1, 2026
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.



PlatformSDKHttpgetslistMyPolicies, a method forGET /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 thePlatformSDKinterface and onPlatformSDKHttp. It followslistGrants: 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 noapplication_id. An application ID goes out as theapplication_idquery parameter. A 500 rejects withAPIError.packages/cli/src/cli-functions.spec.ts: the SDK mock lists everyPlatformSDKmethod and is checked withsatisfies PlatformSDK, so it gets the new method. The CLI gets no command for the policies.Release
This is the first
featcommit 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 addsartifacts_expire_atto 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:checkandnpm run testpass locally (SDK 143 tests, CLI 247).🤖 Generated with Claude Code