@commet/node 9.5.0 → 9.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/index.d.mts +90 -51
  2. package/dist/index.d.ts +90 -51
  3. package/dist/index.js +11 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +11 -2
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/commet-skill.md +1 -1
  8. package/docs/ai-onboarding/mcp-server.md +1 -1
  9. package/docs/api-reference/index.md +1 -1
  10. package/docs/api-reference/offers.md +2 -2
  11. package/docs/api-reference/plans.md +1 -1
  12. package/docs/api-reference/promo-codes.md +2 -2
  13. package/docs/api-reference/subscriptions.md +29 -4
  14. package/docs/documentation/api-versioning.md +1 -0
  15. package/docs/documentation/better-auth.md +1 -8
  16. package/docs/documentation/cli.md +13 -13
  17. package/docs/documentation/customers/customer-portal.md +1 -7
  18. package/docs/documentation/customers/manage-customers.md +0 -6
  19. package/docs/documentation/error-handling.md +1 -1
  20. package/docs/documentation/finance/acceptable-use.md +1 -6
  21. package/docs/documentation/finance/finance-overview.md +0 -5
  22. package/docs/documentation/finance/local-currency-taxes.md +0 -6
  23. package/docs/documentation/finance/merchant-of-record.md +0 -7
  24. package/docs/documentation/finance/payouts-verification.md +0 -5
  25. package/docs/documentation/finance/payouts.md +0 -6
  26. package/docs/documentation/finance/supported-countries.md +1 -6
  27. package/docs/documentation/go/integrate-with-encore.md +1 -8
  28. package/docs/documentation/go/integrate-with-go.md +1 -8
  29. package/docs/documentation/invoicing/handle-failed-payments.md +3 -9
  30. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +10 -15
  31. package/docs/documentation/java/integrate-with-java.md +1 -5
  32. package/docs/documentation/nodejs/integrate-with-astro.md +1 -8
  33. package/docs/documentation/nodejs/integrate-with-bun.md +1 -8
  34. package/docs/documentation/nodejs/integrate-with-express.md +1 -8
  35. package/docs/documentation/nodejs/integrate-with-hono.md +1 -8
  36. package/docs/documentation/nodejs/integrate-with-nextjs.md +1 -8
  37. package/docs/documentation/nodejs/integrate-with-nuxt.md +1 -8
  38. package/docs/documentation/nodejs/integrate-with-remix.md +1 -8
  39. package/docs/documentation/nodejs/integrate-with-sveltekit.md +1 -8
  40. package/docs/documentation/payments/accept-one-time-payments.md +0 -8
  41. package/docs/documentation/payments/payment-orchestration.md +0 -6
  42. package/docs/documentation/payments/payment-providers.md +0 -6
  43. package/docs/documentation/php/integrate-with-laravel.md +1 -8
  44. package/docs/documentation/php/integrate-with-php.md +1 -7
  45. package/docs/documentation/php/integrate-with-symfony.md +1 -8
  46. package/docs/documentation/plans/add-ons.md +0 -8
  47. package/docs/documentation/plans/balance-and-top-ups.md +1 -1
  48. package/docs/documentation/plans/configure-features.md +1 -8
  49. package/docs/documentation/plans/consumption-models.md +7 -14
  50. package/docs/documentation/plans/create-plans.md +0 -9
  51. package/docs/documentation/plans/credit-packs.md +0 -7
  52. package/docs/documentation/plans/one-time-payments.md +36 -7
  53. package/docs/documentation/plans/plan-groups.md +0 -6
  54. package/docs/documentation/python/integrate-with-django.md +1 -8
  55. package/docs/documentation/python/integrate-with-fastapi.md +1 -8
  56. package/docs/documentation/python/integrate-with-flask.md +1 -8
  57. package/docs/documentation/python/integrate-with-python.md +1 -8
  58. package/docs/documentation/sales/introductory-offers.md +1 -9
  59. package/docs/documentation/sales/offers.md +0 -8
  60. package/docs/documentation/sales/promo-codes.md +0 -7
  61. package/docs/documentation/sales/promotional-offers.md +0 -7
  62. package/docs/documentation/sales/regional-prices.md +0 -7
  63. package/docs/documentation/sales/trial-periods.md +0 -8
  64. package/docs/documentation/sdk-reference.md +1 -1
  65. package/docs/documentation/subscriptions/manage-subscriptions.md +2 -9
  66. package/docs/documentation/subscriptions/pay-in-advance.md +161 -0
  67. package/docs/documentation/subscriptions/plan-grants.md +0 -6
  68. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +1 -7
  69. package/docs/documentation/testing-sandbox.md +1 -1
  70. package/docs/documentation/usage/ai-token-billing.md +0 -6
  71. package/docs/documentation/usage/quota-management.md +1 -7
  72. package/docs/documentation/usage/seat-management.md +1 -7
  73. package/docs/documentation/usage/track-usage.md +1 -7
  74. package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +1 -1
  75. package/docs/knowledge-base/how-do-discounts-work.md +0 -8
  76. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +9 -15
  77. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +6 -12
  78. package/docs/knowledge-base/how-do-trial-periods-work.md +1 -8
  79. package/docs/knowledge-base/how-does-billing-work.md +1 -1
  80. package/docs/knowledge-base/how-does-quota-based-billing-work.md +1 -7
  81. package/docs/knowledge-base/how-does-seat-based-billing-work.md +1 -7
  82. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +1 -7
  83. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +2 -6
  84. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +1 -7
  85. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -7
  86. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +13 -19
  87. package/docs/manifest.json +8 -1
  88. package/docs/platform-documentation.md +1 -0
  89. package/docs/schemas.md +23 -13
  90. package/docs/webhooks/introduction.md +3 -3
  91. package/docs/webhooks.md +4 -4
  92. package/docs/webhooks.openapi.json +15 -5
  93. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -709,7 +709,7 @@ var SubscriptionsResource = class {
709
709
  options
710
710
  );
711
711
  }
712
- /** Creates a hosted checkout session for the customer to update the subscription's default payment method. */
712
+ /** Creates a hosted checkout to update the payment method of an active, trialing or past_due subscription. Pending-payment subscriptions must use their payment checkout. */
713
713
  async updatePaymentMethod(params, options) {
714
714
  const { id, ...rest } = params;
715
715
  return this.httpClient.post(
@@ -718,6 +718,15 @@ var SubscriptionsResource = class {
718
718
  options
719
719
  );
720
720
  }
721
+ /** Creates a hosted checkout to pay billing periods of a recurring subscription in advance with any payment method. On an active subscription the paid periods start after the last paid period and replace any open prepaid-periods checkout. On a pending-payment subscription the first payment covers the requested periods and replaces its pending checkout. The billing interval does not change. */
722
+ async createPrepaidPeriodsCheckout(params, options) {
723
+ const { id, ...rest } = params;
724
+ return this.httpClient.post(
725
+ `/subscriptions/${id}/prepaid-periods`,
726
+ rest,
727
+ options
728
+ );
729
+ }
721
730
  /** Preview proration details for an immediate plan change without applying it. Free-to-paid changes are never scheduled and the change-plan endpoint always returns hosted checkout for them. For paid plans, interval direction takes precedence: a longer interval is immediate and a shorter interval is scheduled. When the interval is unchanged, a higher-sort-order plan is immediate and a lower-sort-order plan is scheduled. A paid-to-free change is always scheduled. Returns credit, charge, and net amount. The target plan must belong to the same plan group as the current plan, otherwise a 400 with code `plans_not_in_same_group` is returned. A change between two free plans has nothing to prorate and returns a zero-amount estimate. Scheduled changes return a 400 with code `plan_change_scheduled`; apply those via the change-plan endpoint. Pass offerId to quote the destination plan with an Offer. */
722
731
  async previewChange(params, options) {
723
732
  const { id, ...rest } = params;
@@ -1015,7 +1024,7 @@ var CommetValidationError = class extends CommetAPIError {
1015
1024
 
1016
1025
  // src/version.ts
1017
1026
  var API_VERSION = "2026-08-27";
1018
- var SDK_VERSION = "9.5.0";
1027
+ var SDK_VERSION = "9.7.0";
1019
1028
 
1020
1029
  // src/utils/telemetry.ts
1021
1030
  var registeredIntegrations = /* @__PURE__ */ new Set();