Skip to content

feat: correct visibility annotations for subscription add-on create and list-apps - #5179

Merged
rolosp merged 2 commits into
mainfrom
feat/v3-annotation-fixes
Sep 23, 2026
Merged

rolosp merged 2 commits into
mainfrom
feat/v3-annotation-fixes

Conversation

@rolosp

@rolosp rolosp commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes two API visibility annotations flagged in Konnect review:

  • create-subscription-addon: add x-internal — this endpoint is not yet public, so it should stay internal-only (it was inadvertently exposed to the public beta SDK).
  • list-apps: remove x-unstable/x-internal/x-private — it's a GA public endpoint; the extensions were hiding it from the public SDK (matches get-app, which has none).

Summary by CodeRabbit

  • New Features

    • Apps can now be listed through the public API, including single-page and complete-list retrieval in the JavaScript SDK.
    • Internal subscription workflows now support creating subscription add-ons.
    • Credit balances and transactions now expose custom currencies as resource references.
  • Changes

    • Subscription add-on creation is no longer available through the public JavaScript SDK.
    • Internal app listing methods are no longer available.
    • Custom currency identifiers were replaced by custom currency references in credit responses.
  • Documentation

    • SDK reference tables and custom-currency documentation were updated.

RetriggerConfidence Score: 5/5

The PR appears safe to merge because its visibility changes and regenerated client surfaces are aligned, and no blocking correctness or rule-compliance issue remains.

Summary

This PR corrects API visibility metadata and regenerates the corresponding contracts and SDK surfaces. It also updates unstable customer-credit responses to represent managed custom currencies as nested resource references.

  • Makes installed-app listing available through the public JavaScript SDK, including all-page iteration.
  • Moves subscription add-on creation from the public SDK to the internal SDK.
  • Keeps TypeSpec, OpenAPI, generated Go contracts, JavaScript models, handlers, tests, and documentation aligned.
  • Adds end-to-end coverage for custom-currency references in balance and transaction responses.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  TS[TypeSpec visibility annotations] --> Gen[API and SDK generation]
  Gen --> Public[Public SDK surface]
  Gen --> Internal[Internal SDK surface]
  Apps[list-apps] --> Public
  Addon[create-subscription-addon] --> Internal
  Credit[Credit response schema] --> Ref[custom_currency.id reference]
  Ref --> Go[Generated Go models]
  Ref --> JS[Generated JavaScript models]
  Ref --> Handler[Credit response converters]
Loading

Reviews (3) · Last reviewed commit: "refactor: inline custom_currency_id to c..."

@rolosp
rolosp requested a review from a team as a code owner September 22, 2026 11:28
@rolosp rolosp added the release-note/misc Miscellaneous changes label Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openmeterio/openmeter/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3ea6288c-fd00-4ead-b5c7-454c5fe8fa7b

📥 Commits

Reviewing files that changed from the base of the PR and between ab8084e and 1f9c65c.

⛔ Files ignored due to path filters (1)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
📒 Files selected for processing (12)
  • api/spec/packages/aip-client-javascript/src/index.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip/src/customers/credits/balance.tsp
  • api/spec/packages/aip/src/customers/credits/ledger.tsp
  • api/v3/api.gen.go
  • api/v3/client/models_customers.go
  • api/v3/handlers/customers/credits/convert.go
  • api/v3/handlers/customers/credits/convert_test.go
  • api/v3/handlers/customers/credits/list_transactions_test.go
  • e2e/customer_credits_v3_test.go
  • openmeter/ledger/customerbalance/README.md

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The API now exposes app listing publicly and subscription add-on creation internally. The JavaScript SDK reflects these boundaries. Credit balance and transaction responses now use nested custom currency references, with updated generated models, handlers, tests, and documentation.

Changes

SDK API alignment

Layer / File(s) Summary
API operation exposure
api/spec/packages/aip/src/apps/operations.tsp, api/spec/packages/aip/src/subscriptions/operations.tsp, api/v3/api.gen.go
The apps list operation becomes public. The subscription add-on operation gains the internal extension. The embedded specification payload changes.
Public SDK listing and subscription surface
api/spec/packages/aip-client-javascript/src/sdk/apps.ts, api/spec/packages/aip-client-javascript/src/sdk/subscriptions.ts, api/spec/packages/aip-client-javascript/README.md
The public Apps SDK adds list and listAll. The public Subscriptions SDK removes createAddon. The README tables reflect these methods.
Internal SDK subscription and app surface
api/spec/packages/aip-client-javascript/src/sdk/internal.ts, api/spec/packages/aip-client-javascript/README.md
The internal SDK adds InternalSubscriptions.createAddon and removes internal app listing methods. The README tables reflect these methods.

Custom currency reference

Layer / File(s) Summary
Currency reference contracts
api/spec/packages/aip/src/customers/credits/*, api/spec/packages/aip-client-javascript/src/models/*, api/spec/packages/aip-client-javascript/src/index.ts
Credit balances and transactions replace custom_currency_id with a custom_currency resource reference. Generated JavaScript schemas and types expose CurrencyCustomReference.
Currency reference API wiring
api/v3/client/models_customers.go, api/v3/handlers/customers/credits/convert.go
Generated Go models and credit conversion handlers populate nested custom currency references.
Currency reference validation and documentation
api/v3/handlers/customers/credits/*_test.go, e2e/customer_credits_v3_test.go, openmeter/ledger/customerbalance/README.md
Tests validate nested references and nil values for fiat currencies. The end-to-end test covers balance and transaction responses. Documentation uses custom_currency.id.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Suggested reviewers: tothandras

Sequence Diagram(s)

sequenceDiagram
  participant Apps
  participant listApps
  participant paginatePages
  Apps->>listApps: Request one page
  listApps-->>Apps: Return ListAppsResponse
  Apps->>paginatePages: Request all pages
  paginatePages-->>Apps: Return AsyncIterable<App>
Loading

Merge Risk: ⚪ Minimal · up to 1f9c6

App listing and subscription add-on visibility now match their intended SDK surfaces, while credit responses consistently expose nested custom-currency references; no concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: visibility annotation updates for subscription add-on creation and app listing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rolosp
rolosp force-pushed the feat/v3-annotation-fixes branch from 480575e to ab8084e Compare September 22, 2026 11:38
borosr
borosr previously approved these changes Sep 22, 2026
@rolosp
rolosp merged commit 080b750 into main Sep 23, 2026
50 of 51 checks passed
@rolosp
rolosp deleted the feat/v3-annotation-fixes branch September 23, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/misc Miscellaneous changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants