@commet/node 9.10.0 → 9.11.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 (33) hide show
  1. package/dist/index.d.mts +123 -48
  2. package/dist/index.d.ts +123 -48
  3. package/dist/index.js +14 -11
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +14 -11
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/api-reference/customers.md +3 -3
  8. package/docs/api-reference/index.md +1 -1
  9. package/docs/api-reference/invoices.md +4 -3
  10. package/docs/api-reference/plans.md +8 -4
  11. package/docs/api-reference/subscriptions.md +5 -4
  12. package/docs/api-reference/transactions.md +2 -1
  13. package/docs/documentation/invoicing/manage-invoices.md +1 -1
  14. package/docs/documentation/plans/add-ons.md +2 -2
  15. package/docs/documentation/plans/balance-and-top-ups.md +1 -1
  16. package/docs/documentation/plans/consumption-models.md +20 -0
  17. package/docs/documentation/plans/credit-packs.md +4 -2
  18. package/docs/documentation/plans/plan-versions.md +9 -7
  19. package/docs/documentation/sales/regional-prices.md +1 -1
  20. package/docs/documentation/subscriptions/manage-subscriptions.md +1 -1
  21. package/docs/errors/currency_held_by_balance_plan.md +22 -0
  22. package/docs/errors/currency_held_by_customer_credit.md +22 -0
  23. package/docs/errors/currency_held_by_fixed_amount_discount.md +22 -0
  24. package/docs/errors/currency_held_by_payment_method.md +22 -0
  25. package/docs/errors/currency_held_by_prepaid_period.md +22 -0
  26. package/docs/errors/currency_held_by_scheduled_pause.md +22 -0
  27. package/docs/errors/index.md +7 -1
  28. package/docs/errors/missing_regional_price.md +3 -3
  29. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -1
  30. package/docs/manifest.json +37 -1
  31. package/docs/schemas.md +22 -14
  32. package/docs/webhooks.md +4 -3
  33. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -223,10 +223,13 @@ var InvoicesResource = class {
223
223
  const { id } = params;
224
224
  return this.httpClient.post(`/invoices/${id}/send`, {}, options);
225
225
  }
226
- /** Mark an outstanding invoice as "paid" or "void" and return the updated invoice. Cannot change the status of already paid or voided invoices. */
226
+ /**
227
+ * Deprecated. No longer changes the invoice. An invoice is paid when its charge settles: to collect a past-due subscription, reactivate it or send the customer a recovery link.
228
+ * @deprecated
229
+ */
227
230
  async updateStatus(params, options) {
228
- const { id, ...rest } = params;
229
- return this.httpClient.patch(`/invoices/${id}/status`, rest, options);
231
+ const { id } = params;
232
+ return this.httpClient.patch(`/invoices/${id}/status`, {}, options);
230
233
  }
231
234
  /** List invoices with cursor-based pagination. Filter by customer, status, or subscription. */
232
235
  async list(params, options) {
@@ -809,7 +812,7 @@ var SubscriptionsResource = class {
809
812
  options
810
813
  );
811
814
  }
812
- /** Activate an add-on on a subscription. Charges a prorated amount for the current billing period. An add-on that the subscription's plan version does not sell is rejected with addon_unavailable. */
815
+ /** Activate an add-on on a subscription. Creates the activation invoice and charges a prorated amount for the current billing period; the add-on is active once the payment is confirmed. Rejected with 409 while the add-on is active or an activation of it is still processing. An add-on that the subscription's plan version does not sell is rejected with addon_unavailable. */
813
816
  async activateAddon(params, options) {
814
817
  const { id, ...rest } = params;
815
818
  return this.httpClient.post(`/subscriptions/${id}/addons`, rest, options);
@@ -841,7 +844,7 @@ var SubscriptionsResource = class {
841
844
  options
842
845
  );
843
846
  }
844
- /** Top up a balance subscription. Charges the customer's payment method for the amount plus tax, adds it to the subscription's purchased balance (after paying back any overage owed on the plan balance), creates its invoice and emits `balance.topped_up`. Purchased balance is spent after the plan balance and is kept until the subscription ends. Rejected with 400 when the subscription is not on a balance plan, its plan has top-ups turned off, or the amount is below the effective minimum: the plan's minimum top-up in the subscription currency, raised to the currency's minimum charge. */
847
+ /** Top up a balance subscription. Creates the top-up invoice and charges the customer's payment method for the amount plus tax. Once the payment is confirmed, adds the amount to the subscription's purchased balance (after paying back any overage owed on the plan balance), marks the invoice paid and emits `balance.topped_up`. Purchased balance is spent after the plan balance and is kept until the subscription ends. Rejected with 400 when the subscription is not on a balance plan, its plan has top-ups turned off, or the amount is below the effective minimum: the plan's minimum top-up in the subscription currency, raised to the currency's minimum charge. */
845
848
  async topupBalance(params, options) {
846
849
  const { id, ...rest } = params;
847
850
  return this.httpClient.post(
@@ -864,7 +867,7 @@ var SubscriptionsResource = class {
864
867
  options
865
868
  );
866
869
  }
867
- /** Move a subscription to a newer published version of its plan, now or at the end of the period, without proration; an older version is rejected with version_not_newer, and a subscription on a running experiment moves only to a later version of that experiment. The subscription keeps its currency and its price: a destination that does not sell its currency is rejected with missing_regional_price, and one that does not sell the price it pays with price_not_found. A free version moves only to a free version and a paid one only to a paid one (validation_error). A subscription whose usage does not fit the destination, or with an active add-on the destination does not sell, is not moved either, and the error says why. Each change is recorded as a move of this one subscription in the plan's moves. Repeating the same request changes nothing; a new one replaces the pending move. */
870
+ /** Move a subscription to a newer published version of its plan, now or at the end of the period, without proration; an older version is rejected with version_not_newer, and a subscription on a running experiment moves only to a later version of that experiment. The subscription keeps its currency and its price: a destination that does not sell its currency is rejected with missing_regional_price unless currency asks to charge it in USD from its renewal, and one that does not sell the price it pays with price_not_found. A free version moves only to a free version and a paid one only to a paid one (validation_error). A subscription whose usage does not fit the destination, or with an active add-on the destination does not sell, is not moved either, and the error says why. Each change is recorded as a move of this one subscription in the plan's moves. Repeating the same request changes nothing; a new one replaces the pending move. */
868
871
  async changeVersion(params, options) {
869
872
  const { id, ...rest } = params;
870
873
  return this.httpClient.post(
@@ -873,7 +876,7 @@ var SubscriptionsResource = class {
873
876
  options
874
877
  );
875
878
  }
876
- /** Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Charges the saved payment method and adds purchased credits. A credit pack that the subscription's plan version does not sell is rejected with credit_pack_unavailable. */
879
+ /** Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Creates the purchase invoice, charges the saved payment method and adds the purchased credits once the payment is confirmed. A credit pack that the subscription's plan version does not sell is rejected with credit_pack_unavailable. */
877
880
  async purchaseCredits(params, options) {
878
881
  const { id, ...rest } = params;
879
882
  return this.httpClient.post(`/subscriptions/${id}/credits`, rest, options);
@@ -1030,10 +1033,10 @@ var TransactionsResource = class {
1030
1033
  constructor(httpClient) {
1031
1034
  this.httpClient = httpClient;
1032
1035
  }
1033
- /** Issue a full refund and return the provider-neutral refund resource with its actual status. */
1036
+ /** Refund a positive amount in the payment currency’s smallest unit, or omit amount to refund the remaining amount. Returns the refund resource with its actual status. */
1034
1037
  async refund(params, options) {
1035
- const { id } = params;
1036
- return this.httpClient.post(`/transactions/${id}/refund`, {}, options);
1038
+ const { id, ...rest } = params;
1039
+ return this.httpClient.post(`/transactions/${id}/refund`, rest, options);
1037
1040
  }
1038
1041
  /** Retry a failed subscription renewal and return an honest retry result. The original failed transaction remains immutable. */
1039
1042
  async retry(params, options) {
@@ -1244,7 +1247,7 @@ var CommetValidationError = class extends CommetAPIError {
1244
1247
 
1245
1248
  // src/version.ts
1246
1249
  var API_VERSION = "2026-08-27";
1247
- var SDK_VERSION = "9.10.0";
1250
+ var SDK_VERSION = "9.11.0";
1248
1251
 
1249
1252
  // src/utils/telemetry.ts
1250
1253
  var registeredIntegrations = /* @__PURE__ */ new Set();