Commit 18bf1db
stripe: add opt-in pagination metadata to list actions (#20744)
* stripe: return full list response with has_more across all list actions
Fixes #20702. All six Stripe list actions were using
.autoPagingToArray() which returns a plain array and discards the
Stripe list envelope, including has_more. Users had no way to know
whether additional pages existed.
Changes:
- Switch from .autoPagingToArray() to direct .list() call with limit
- Return the full Stripe list object (data, has_more, url)
- Update $summary to include count and pagination state
- Add startingAfter/endingBefore cursor props to list-refunds and
list-payment-intents which were missing them
- Bump all six actions to 0.1.5
Note: this is a breaking change — return type changes from Array to
Stripe list object. Callers should access resp.data for the items.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* stripe: bump to v1.0.0 for breaking changes per repo guidelines
Per the repo's component versioning guidelines, output shape changes
and behavior changes that break existing configs require a major
version bump. The previous patch bump (0.1.4 -> 0.1.5) was incorrect.
- All six list actions: 0.1.5 -> 1.0.0
- components/stripe/package.json: 0.8.1 -> 1.0.0
The breaking changes are:
- Return type changes from Array to a Stripe list object
- limit param is now per-page only (max 100); auto-pagination removed
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* stripe: refactor to non-breaking pagination metadata via exports
Replaces the breaking-change approach with a backwards-compatible one:
- Return value remains Array<T> (no breaking change for existing workflows)
- Pagination metadata exposed via $.export:
- has_more: boolean
- next_starting_after: cursor for the next page (or null)
- Action descriptions updated to tell agents where to find the metadata
and how to use the cursor for the next page
- $summary includes pagination state for high-visibility surfacing
Implementation note: actions internally request limit+1 items via
autoPagingToArray, then trim back to limit before returning. This
detects has_more accurately without an extra peek call.
Versions:
- All six list actions: 0.1.4 -> 0.2.0 (minor: new exports + new
optional cursor props on list-refunds/list-payment-intents)
- components/stripe/package.json: 0.8.1 -> 0.9.0 (minor)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* stripe: switch to opt-in flag for pagination metadata
Replaces the exports-based approach with an opt-in `Return Pagination
Info` boolean prop. This guarantees the pagination metadata reaches
agents through MCP (the previous approach relied on $.export data
surfacing in the MCP response, which was unverified).
Behavior:
- Default (returnPaginationInfo: false): backwards-compatible behavior,
returns Array<T> exactly as before. Zero change for existing
workflows or callers.
- Opt-in (returnPaginationInfo: true): returns
{ data, has_more, next_starting_after }. Internally fetches limit+1
to detect has_more accurately, then trims to limit.
Also adds startingAfter/endingBefore cursor props to list-refunds and
list-payment-intents, which were missing them.
* stripe: fix multiline-ternary lint errors in list action summaries
Extracts count, noun, and pagination suffix into local variables before
building the $summary string. This avoids inline nested ternaries that
were tripping the multiline-ternary ESLint rule and replaces existing
eslint-disable comments on list-payouts and list-refunds with the same
clean pattern.
* stripe: centralize pagination in app helper, use native has_more
Replaces the per-action `limit + 1` peek with a centralized `paginate`
helper in stripe.app.mjs that uses Stripe's native `has_more` from the
list response envelope. Each action now calls
`app.paginate({ collection, params, limit, returnPaginationInfo })`
instead of duplicating pagination logic.
When returnPaginationInfo is true:
- Limit is clamped to 100 (Stripe's per-page max)
- Single API call, no peek trick
- Returns { data, has_more, next_starting_after } using Stripe's
native has_more value
When returnPaginationInfo is false (default):
- Unchanged: autoPagingToArray with the user's limit
Action descriptions updated to note the 100-per-call cap on opt-in.
* stripe: bump dependent component versions for app file change
The CI rule requires every component that imports stripe.app.mjs to
have its version bumped when the app file is modified. Patch-bumping
all 52 dependents per the CI-generated command.
* stripe: validate pagination prop combos, share returnPaginationInfo def
* stripe: sharpen returnPaginationInfo description with cursor-chaining hint
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent 9d8303c commit 18bf1db
60 files changed
Lines changed: 382 additions & 110 deletions
File tree
- components/stripe
- actions
- cancel-or-reverse-payout
- cancel-payment-intent
- cancel-subscription
- capture-payment-intent
- confirm-payment-intent
- create-billing-meter
- create-customer
- create-invoice-item
- create-invoice
- create-payment-intent
- create-payout
- create-price
- create-product
- create-refund
- create-subscription
- delete-customer
- delete-invoice-item
- delete-or-void-invoice
- finalize-invoice
- list-balance-history
- list-customers
- list-invoices
- list-payment-intents
- list-payouts
- list-refunds
- retrieve-balance
- retrieve-checkout-session-line-items
- retrieve-checkout-session
- retrieve-customer
- retrieve-invoice-item
- retrieve-invoice
- retrieve-payment-intent
- retrieve-payout
- retrieve-price
- retrieve-product
- retrieve-refund
- search-customers
- search-subscriptions
- send-invoice
- update-customer
- update-invoice-item
- update-invoice
- update-payment-intent
- update-payout
- update-refund
- void-invoice
- write-off-invoice
- sources
- abandoned-cart
- canceled-subscription
- custom-webhook-events
- new-customer
- new-dispute
- new-failed-invoice-payment
- new-failed-payment
- new-invoice
- new-payment
- new-subscription
- subscription-updated
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments