@commet/node 9.2.0 → 9.4.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.
- package/dist/index.d.mts +370 -21
- package/dist/index.d.ts +370 -21
- package/dist/index.js +30 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -6
- package/dist/index.mjs.map +1 -1
- package/docs/api-reference/addons.md +1 -1
- package/docs/api-reference/api-keys.md +3 -2
- package/docs/api-reference/credit-packs.md +1 -1
- package/docs/api-reference/customers.md +2 -2
- package/docs/api-reference/feature-access.md +1 -1
- package/docs/api-reference/features.md +1 -1
- package/docs/api-reference/generated-webhooks.md +3 -3
- package/docs/api-reference/index.md +2 -2
- package/docs/api-reference/invoices.md +1 -1
- package/docs/api-reference/markets.md +1 -1
- package/docs/api-reference/offers.md +1 -1
- package/docs/api-reference/payments.md +1 -1
- package/docs/api-reference/payouts.md +1 -1
- package/docs/api-reference/plan-groups.md +1 -1
- package/docs/api-reference/plans.md +4 -4
- package/docs/api-reference/portal.md +1 -1
- package/docs/api-reference/promo-codes.md +1 -1
- package/docs/api-reference/provisioning.md +1 -1
- package/docs/api-reference/quota.md +1 -1
- package/docs/api-reference/seats.md +1 -1
- package/docs/api-reference/subscriptions.md +81 -2
- package/docs/api-reference/test-clock.md +1 -1
- package/docs/api-reference/transactions.md +1 -1
- package/docs/api-reference/usage.md +1 -1
- package/docs/documentation/api-versioning.md +1 -1
- package/docs/documentation/choose-a-billing-model.md +48 -26
- package/docs/documentation/create-api-key.md +101 -25
- package/docs/documentation/introduction.md +63 -41
- package/docs/documentation/payments/transactions-refunds-and-retries.md +7 -1
- package/docs/documentation/sales/promotional-offers.md +18 -1
- package/docs/documentation/sdk-reference.md +9 -9
- package/docs/documentation/subscriptions/manage-subscriptions.md +113 -12
- package/docs/errors/addon_already_active.md +1 -1
- package/docs/errors/addon_has_activations.md +1 -1
- package/docs/errors/addon_not_active.md +1 -1
- package/docs/errors/addon_not_found.md +1 -1
- package/docs/errors/already_has_active_subscription.md +1 -1
- package/docs/errors/already_scheduled.md +1 -1
- package/docs/errors/api_key_not_found.md +1 -1
- package/docs/errors/card_promotions_not_available.md +1 -1
- package/docs/errors/charge_failed.md +1 -1
- package/docs/errors/charge_in_progress.md +1 -1
- package/docs/errors/claim_not_pending.md +1 -1
- package/docs/errors/credit_pack_not_found.md +1 -1
- package/docs/errors/customer_not_found.md +1 -1
- package/docs/errors/duplicate.md +1 -1
- package/docs/errors/endpoint_deprecated.md +1 -1
- package/docs/errors/endpoint_not_available.md +1 -1
- package/docs/errors/feature_already_exists.md +1 -1
- package/docs/errors/feature_disabled.md +1 -1
- package/docs/errors/feature_in_use.md +1 -1
- package/docs/errors/feature_not_found.md +1 -1
- package/docs/errors/feature_not_in_plan.md +1 -1
- package/docs/errors/forbidden.md +1 -1
- package/docs/errors/free_plan_change_not_supported.md +1 -1
- package/docs/errors/idempotency_in_progress.md +1 -1
- package/docs/errors/idempotency_key_mismatch.md +1 -1
- package/docs/errors/idempotency_unavailable.md +1 -1
- package/docs/errors/included_limit_reached.md +1 -1
- package/docs/errors/index.md +1 -1
- package/docs/errors/insufficient_balance.md +1 -1
- package/docs/errors/insufficient_credits.md +1 -1
- package/docs/errors/insufficient_seats.md +1 -1
- package/docs/errors/internal_error.md +1 -1
- package/docs/errors/invalid_json.md +1 -1
- package/docs/errors/invalid_subscription_status.md +1 -1
- package/docs/errors/invoice_not_found.md +1 -1
- package/docs/errors/market_group_in_use.md +1 -1
- package/docs/errors/market_group_not_found.md +1 -1
- package/docs/errors/market_in_use.md +1 -1
- package/docs/errors/market_not_found.md +1 -1
- package/docs/errors/missing_regional_price.md +1 -1
- package/docs/errors/model_not_found.md +1 -1
- package/docs/errors/no_active_subscription.md +1 -1
- package/docs/errors/no_change_requested.md +1 -1
- package/docs/errors/no_outstanding_invoice.md +1 -1
- package/docs/errors/no_payment_method.md +1 -1
- package/docs/errors/no_prices_configured.md +1 -1
- package/docs/errors/not_found.md +1 -1
- package/docs/errors/not_scheduled_for_cancellation.md +1 -1
- package/docs/errors/offer_not_applicable.md +1 -1
- package/docs/errors/offer_not_found.md +1 -1
- package/docs/errors/one_time_subscription_not_cancelable.md +1 -1
- package/docs/errors/organization_already_claimed.md +1 -1
- package/docs/errors/payment_failed.md +1 -1
- package/docs/errors/payment_method_not_found.md +1 -1
- package/docs/errors/payment_not_cancelable.md +1 -1
- package/docs/errors/payment_not_found.md +1 -1
- package/docs/errors/payouts_not_available_in_sandbox.md +1 -1
- package/docs/errors/plan_change_scheduled.md +1 -1
- package/docs/errors/plan_group_not_found.md +1 -1
- package/docs/errors/plan_not_found.md +1 -1
- package/docs/errors/plan_unavailable.md +1 -1
- package/docs/errors/plans_not_in_same_group.md +1 -1
- package/docs/errors/price_in_use.md +1 -1
- package/docs/errors/price_not_found.md +1 -1
- package/docs/errors/pricing_mode_mismatch.md +1 -1
- package/docs/errors/promo_code_expired.md +1 -1
- package/docs/errors/promo_code_not_found.md +1 -1
- package/docs/errors/provider_unsupported.md +1 -1
- package/docs/errors/rate_limited.md +1 -1
- package/docs/errors/sandbox_only.md +1 -1
- package/docs/errors/seat_limit_exceeded.md +1 -1
- package/docs/errors/subscription_activation_failed.md +1 -1
- package/docs/errors/subscription_already_canceled.md +1 -1
- package/docs/errors/subscription_cancel_failed.md +1 -1
- package/docs/errors/subscription_creation_failed.md +1 -1
- package/docs/errors/subscription_has_open_dispute.md +1 -1
- package/docs/errors/subscription_not_active.md +1 -1
- package/docs/errors/subscription_not_found.md +1 -1
- package/docs/errors/subscription_required.md +1 -1
- package/docs/errors/subscription_uncancel_failed.md +1 -1
- package/docs/errors/transaction_not_found.md +1 -1
- package/docs/errors/unauthorized.md +1 -1
- package/docs/errors/validation_error.md +1 -1
- package/docs/errors/webhook_not_found.md +1 -1
- package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +2 -2
- package/docs/manifest.json +121 -85
- package/docs/platform-documentation.md +6 -0
- package/docs/schemas.md +35 -1
- package/docs/webhooks/addon-activated.md +1 -1
- package/docs/webhooks/addon-deactivated.md +1 -1
- package/docs/webhooks/balance-depleted.md +1 -1
- package/docs/webhooks/balance-low.md +1 -1
- package/docs/webhooks/balance-topped-up.md +1 -1
- package/docs/webhooks/checkout-ready.md +1 -1
- package/docs/webhooks/credits-depleted.md +1 -1
- package/docs/webhooks/credits-expired.md +1 -1
- package/docs/webhooks/credits-granted.md +1 -1
- package/docs/webhooks/credits-low.md +1 -1
- package/docs/webhooks/credits-purchased.md +1 -1
- package/docs/webhooks/customer-created.md +1 -1
- package/docs/webhooks/customer-state-changed.md +2 -2
- package/docs/webhooks/customer-updated.md +1 -1
- package/docs/webhooks/invoice-created.md +1 -1
- package/docs/webhooks/invoice-overdue.md +1 -1
- package/docs/webhooks/invoice-upcoming.md +1 -1
- package/docs/webhooks/invoice-voided.md +1 -1
- package/docs/webhooks/meta.json +6 -0
- package/docs/webhooks/payment-dispute-resolved.md +1 -1
- package/docs/webhooks/payment-disputed.md +1 -1
- package/docs/webhooks/payment-failed.md +144 -3
- package/docs/webhooks/payment-link-canceled.md +1 -1
- package/docs/webhooks/payment-link-completed.md +44 -2
- package/docs/webhooks/payment-link-created.md +1 -1
- package/docs/webhooks/payment-link-failed.md +44 -2
- package/docs/webhooks/payment-method-attached.md +6 -2
- package/docs/webhooks/payment-method-updated.md +7 -8
- package/docs/webhooks/payment-received.md +160 -3
- package/docs/webhooks/payment-recovered.md +6 -2
- package/docs/webhooks/payment-refunded.md +3 -3
- package/docs/webhooks/payment-retry-failed.md +1 -1
- package/docs/webhooks/payout-available.md +1 -1
- package/docs/webhooks/payout-created.md +1 -1
- package/docs/webhooks/payout-failed.md +1 -1
- package/docs/webhooks/payout-paid.md +1 -1
- package/docs/webhooks/plan-grant-created.md +1 -1
- package/docs/webhooks/plan-grant-expired.md +1 -1
- package/docs/webhooks/plan-grant-revoked.md +1 -1
- package/docs/webhooks/plan-grant-updated.md +1 -1
- package/docs/webhooks/quota-exceeded.md +1 -1
- package/docs/webhooks/quota-threshold-reached.md +1 -1
- package/docs/webhooks/seats-limit-reached.md +1 -1
- package/docs/webhooks/seats-updated.md +1 -1
- package/docs/webhooks/subscription-activated.md +1 -1
- package/docs/webhooks/subscription-canceled.md +5 -4
- package/docs/webhooks/subscription-cancellation-revoked.md +1 -1
- package/docs/webhooks/subscription-cancellation-scheduled.md +1 -1
- package/docs/webhooks/subscription-created.md +1 -1
- package/docs/webhooks/subscription-past-due.md +1 -1
- package/docs/webhooks/subscription-pause-revoked.md +27 -0
- package/docs/webhooks/subscription-pause-scheduled.md +35 -0
- package/docs/webhooks/subscription-pause-updated.md +31 -0
- package/docs/webhooks/subscription-paused.md +35 -0
- package/docs/webhooks/subscription-plan-change-revoked.md +1 -1
- package/docs/webhooks/subscription-plan-change-scheduled.md +1 -1
- package/docs/webhooks/subscription-plan-changed.md +1 -1
- package/docs/webhooks/subscription-reactivated.md +1 -1
- package/docs/webhooks/subscription-resume-failed.md +33 -0
- package/docs/webhooks/subscription-resumed.md +35 -0
- package/docs/webhooks/subscription-updated.md +1 -1
- package/docs/webhooks/trial-checkout-ready.md +1 -1
- package/docs/webhooks/trial-converted.md +1 -1
- package/docs/webhooks/trial-expired.md +1 -1
- package/docs/webhooks/trial-started.md +1 -1
- package/docs/webhooks/trial-will-end.md +1 -1
- package/docs/webhooks/usage-recorded.md +1 -1
- package/docs/webhooks.md +96 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -92,7 +92,7 @@ var ApiKeysResource = class {
|
|
|
92
92
|
async list(params, options) {
|
|
93
93
|
return this.httpClient.get("/api-keys", params, options);
|
|
94
94
|
}
|
|
95
|
-
/** Create a
|
|
95
|
+
/** Create a full-access or restricted API key. Provide permissions to restrict access; the full key is returned only once. A restricted key with api_key: write may only create restricted keys with the same or fewer permissions, and they expire no later than the key that creates them. */
|
|
96
96
|
async create(params, options) {
|
|
97
97
|
return this.httpClient.post("/api-keys", params, options);
|
|
98
98
|
}
|
|
@@ -722,7 +722,7 @@ var SubscriptionsResource = class {
|
|
|
722
722
|
const { id, ...rest } = params;
|
|
723
723
|
return this.httpClient.post(`/subscriptions/${id}/credits`, rest, options);
|
|
724
724
|
}
|
|
725
|
-
/** Apply
|
|
725
|
+
/** Apply a direct Offer to a subscription. On a pending payment checkout it quotes or replaces the checkout discount and the existing checkout URL remains unchanged. On an active subscription it applies the Offer immediately with its discount phases starting at the next billing cycle; the call is rejected while another applied Offer still has active or upcoming discount phases. Offers with a free trial phase cannot be applied after checkout creation. */
|
|
726
726
|
async applyOffer(params, options) {
|
|
727
727
|
const { id, ...rest } = params;
|
|
728
728
|
return this.httpClient.put(`/subscriptions/${id}/offer`, rest, options);
|
|
@@ -736,6 +736,25 @@ var SubscriptionsResource = class {
|
|
|
736
736
|
options
|
|
737
737
|
);
|
|
738
738
|
}
|
|
739
|
+
/** Pause immediately or schedule a pause for the end of the current billing or trial period. Set durationDays to null for an indefinite pause. */
|
|
740
|
+
async pause(params, options) {
|
|
741
|
+
const { id, ...rest } = params;
|
|
742
|
+
return this.httpClient.post(`/subscriptions/${id}/pause`, rest, options);
|
|
743
|
+
}
|
|
744
|
+
/** Change the duration of a scheduled or active pause. Set durationDays to null to make it indefinite. */
|
|
745
|
+
async updatePause(params, options) {
|
|
746
|
+
const { id, ...rest } = params;
|
|
747
|
+
return this.httpClient.patch(`/subscriptions/${id}/pause`, rest, options);
|
|
748
|
+
}
|
|
749
|
+
/** Revoke a pause before it becomes effective. Active pauses must be resumed instead. */
|
|
750
|
+
async revokePause(params, options) {
|
|
751
|
+
const { id } = params;
|
|
752
|
+
return this.httpClient.delete(
|
|
753
|
+
`/subscriptions/${id}/pause`,
|
|
754
|
+
void 0,
|
|
755
|
+
options
|
|
756
|
+
);
|
|
757
|
+
}
|
|
739
758
|
/** Creates a hosted checkout session for the customer to update the subscription's default payment method. */
|
|
740
759
|
async updatePaymentMethod(params, options) {
|
|
741
760
|
const { id, ...rest } = params;
|
|
@@ -772,6 +791,11 @@ var SubscriptionsResource = class {
|
|
|
772
791
|
options
|
|
773
792
|
);
|
|
774
793
|
}
|
|
794
|
+
/** Resume a paused subscription. Immediate pauses continue the preserved period without a charge. Period-end pauses charge a new period before access is restored. */
|
|
795
|
+
async resume(params, options) {
|
|
796
|
+
const { id } = params;
|
|
797
|
+
return this.httpClient.post(`/subscriptions/${id}/resume`, {}, options);
|
|
798
|
+
}
|
|
775
799
|
/** Get a subscription by its public ID, regardless of status (including pending_payment and past_due). */
|
|
776
800
|
async get(params, options) {
|
|
777
801
|
const { id } = params;
|
|
@@ -1036,8 +1060,8 @@ var CommetValidationError = class extends CommetAPIError {
|
|
|
1036
1060
|
};
|
|
1037
1061
|
|
|
1038
1062
|
// src/version.ts
|
|
1039
|
-
var API_VERSION = "2026-
|
|
1040
|
-
var SDK_VERSION = "9.
|
|
1063
|
+
var API_VERSION = "2026-08-27";
|
|
1064
|
+
var SDK_VERSION = "9.4.0";
|
|
1041
1065
|
|
|
1042
1066
|
// src/utils/telemetry.ts
|
|
1043
1067
|
var registeredIntegrations = /* @__PURE__ */ new Set();
|
|
@@ -1506,9 +1530,9 @@ var Commet = class extends GeneratedResources {
|
|
|
1506
1530
|
if (!config.apiKey) {
|
|
1507
1531
|
throw new Error("Commet SDK: API key is required");
|
|
1508
1532
|
}
|
|
1509
|
-
if (!config.apiKey.startsWith("ck_")) {
|
|
1533
|
+
if (!config.apiKey.startsWith("ck_") && !config.apiKey.startsWith("rk_")) {
|
|
1510
1534
|
throw new Error(
|
|
1511
|
-
"Commet SDK: Invalid API key format. Expected
|
|
1535
|
+
"Commet SDK: Invalid API key format. Expected prefix ck_ or rk_"
|
|
1512
1536
|
);
|
|
1513
1537
|
}
|
|
1514
1538
|
this.httpClient = new CommetHTTPClient(config);
|