Skip to content

Commit 18bf1db

Browse files
s0s0physmclaude
andauthored
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-cancel-or-reverse-payout",
55
name: "Cancel Or Reverse A Payout",
66
type: "action",
7-
version: "0.1.4",
7+
version: "0.1.5",
88
annotations: {
99
destructiveHint: true,
1010
openWorldHint: true,

components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-cancel-payment-intent",
55
name: "Cancel A Payment Intent",
66
type: "action",
7-
version: "0.1.4",
7+
version: "0.1.5",
88
annotations: {
99
destructiveHint: true,
1010
openWorldHint: true,

components/stripe/actions/cancel-subscription/cancel-subscription.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-cancel-subscription",
55
name: "Cancel Subscription",
66
description: "Cancel a subscription. [See the documentation](https://docs.stripe.com/api/subscriptions/cancel?lang=node)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
annotations: {
99
destructiveHint: true,
1010
openWorldHint: true,

components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-capture-payment-intent",
55
name: "Capture a Payment Intent",
66
type: "action",
7-
version: "0.1.4",
7+
version: "0.1.5",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "stripe-confirm-payment-intent",
66
name: "Confirm A Payment Intent",
77
type: "action",
8-
version: "0.1.4",
8+
version: "0.1.5",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/stripe/actions/create-billing-meter/create-billing-meter.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-create-billing-meter",
55
name: "Create Billing Meter",
66
type: "action",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/stripe/actions/create-customer/create-customer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "stripe-create-customer",
66
name: "Create a Customer",
77
type: "action",
8-
version: "0.1.4",
8+
version: "0.1.5",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/stripe/actions/create-invoice-item/create-invoice-item.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-create-invoice-item",
55
name: "Create Invoice Line Item",
66
type: "action",
7-
version: "0.1.4",
7+
version: "0.1.5",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/stripe/actions/create-invoice/create-invoice.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-create-invoice",
55
name: "Create Invoice",
66
type: "action",
7-
version: "0.1.4",
7+
version: "0.1.5",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/stripe/actions/create-payment-intent/create-payment-intent.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "stripe-create-payment-intent",
55
name: "Create a Payment Intent",
66
type: "action",
7-
version: "0.1.4",
7+
version: "0.1.5",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

0 commit comments

Comments
 (0)