@commet/node 7.8.0 → 7.10.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 +59 -11
- package/dist/index.d.ts +59 -11
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -233,6 +233,13 @@ interface CanceledSubscription {
|
|
|
233
233
|
object: "subscription";
|
|
234
234
|
livemode: boolean;
|
|
235
235
|
}
|
|
236
|
+
interface ClaimLink {
|
|
237
|
+
url: string;
|
|
238
|
+
/** @format date-time */
|
|
239
|
+
expiresAt: string;
|
|
240
|
+
object: "claim_link";
|
|
241
|
+
livemode: boolean;
|
|
242
|
+
}
|
|
236
243
|
interface CreatedApiKey {
|
|
237
244
|
id: string;
|
|
238
245
|
name: string;
|
|
@@ -749,6 +756,7 @@ interface PromoCode {
|
|
|
749
756
|
discountType: DiscountType;
|
|
750
757
|
discountValue: number;
|
|
751
758
|
durationCycles: number | null;
|
|
759
|
+
billingInterval: BillingInterval | null;
|
|
752
760
|
maxRedemptions: number | null;
|
|
753
761
|
expiresAt: string | null;
|
|
754
762
|
isActive: boolean;
|
|
@@ -891,6 +899,8 @@ interface Subscription {
|
|
|
891
899
|
billingDayOfMonth: number | null;
|
|
892
900
|
nextBillingDate: string | null;
|
|
893
901
|
checkoutUrl: string | null;
|
|
902
|
+
/** Payment provider resolved for this checkout when the subscription response was created. This is an informational snapshot and may differ when the checkout is loaded if its country or the organization's routing changes. */
|
|
903
|
+
checkoutProvider?: PaymentProvider | null;
|
|
894
904
|
/** @format date-time */
|
|
895
905
|
createdAt: string;
|
|
896
906
|
/** @format date-time */
|
|
@@ -917,6 +927,8 @@ interface TestClockBilling {
|
|
|
917
927
|
customersFound: number;
|
|
918
928
|
enqueued: number;
|
|
919
929
|
failed: number;
|
|
930
|
+
dunningRetried: number;
|
|
931
|
+
dunningFailed: number;
|
|
920
932
|
object: "test_clock";
|
|
921
933
|
livemode: boolean;
|
|
922
934
|
}
|
|
@@ -1628,7 +1640,7 @@ interface UpsertRegionalPricesParams {
|
|
|
1628
1640
|
}
|
|
1629
1641
|
interface SetPlanRegionalPricingParams {
|
|
1630
1642
|
id: string;
|
|
1631
|
-
currency: "ars" | "brl" | "clp" | "cop" | "pen" | "uyu" | "pyg" | "bob" | "mxn" | "cad" | "eur" | "jpy" | "cny" | "krw" | "hkd" | "sgd" | "twd" | "inr" | "thb";
|
|
1643
|
+
currency: "usd" | "ars" | "brl" | "clp" | "cop" | "pen" | "uyu" | "pyg" | "bob" | "mxn" | "cad" | "eur" | "jpy" | "cny" | "krw" | "hkd" | "sgd" | "twd" | "inr" | "thb";
|
|
1632
1644
|
exchangeRate: number;
|
|
1633
1645
|
prices?: Array<{
|
|
1634
1646
|
priceId: string;
|
|
@@ -1681,7 +1693,7 @@ declare class PlansResource {
|
|
|
1681
1693
|
setDefaultPrice(params: SetDefaultPlanPriceParams, options?: RequestOptions): Promise<ApiResponse<DefaultPlanPrice>>;
|
|
1682
1694
|
/** Create or update regional currency price overrides for a plan price. */
|
|
1683
1695
|
setRegionalPrices(params: UpsertRegionalPricesParams, options?: RequestOptions): Promise<ApiResponse<PlanRegionalPricing>>;
|
|
1684
|
-
/** Configure a plan's regional pricing for one currency. Sending only currency and exchangeRate derives every regional value (base price, included balance, feature overage, intro offer) from the USD value
|
|
1696
|
+
/** Configure a plan's regional pricing for one currency. USD configures the United States variant; exchangeRate acts as its price multiplier. Sending only currency and exchangeRate derives every regional value (base price, included balance, feature overage, intro offer) from the default USD value. Optional per-price and per-feature overrides are stored as manual values. */
|
|
1685
1697
|
setRegionalPricing(params: SetPlanRegionalPricingParams, options?: RequestOptions): Promise<ApiResponse<PlanRegionalPricingResult>>;
|
|
1686
1698
|
/** Remove all regional currency overrides for a plan price. */
|
|
1687
1699
|
deleteRegionalPrices(params: DeleteRegionalPricesParams, options?: RequestOptions): Promise<ApiResponse<DeletedPlanRegionalPricing>>;
|
|
@@ -1711,6 +1723,7 @@ interface CreatePromoCodeParams {
|
|
|
1711
1723
|
discountType: DiscountType;
|
|
1712
1724
|
discountValue: number;
|
|
1713
1725
|
durationCycles?: number;
|
|
1726
|
+
billingInterval?: BillingInterval | null;
|
|
1714
1727
|
maxRedemptions?: number;
|
|
1715
1728
|
/** @format date-time */
|
|
1716
1729
|
expiresAt?: string;
|
|
@@ -1718,6 +1731,7 @@ interface CreatePromoCodeParams {
|
|
|
1718
1731
|
}
|
|
1719
1732
|
interface UpdatePromoCodeParams {
|
|
1720
1733
|
id: string;
|
|
1734
|
+
billingInterval?: BillingInterval | null;
|
|
1721
1735
|
maxRedemptions?: number | null;
|
|
1722
1736
|
expiresAt?: string | null;
|
|
1723
1737
|
active?: boolean;
|
|
@@ -1731,15 +1745,22 @@ declare class PromoCodesResource {
|
|
|
1731
1745
|
/** Retrieve a promo code by its public ID. */
|
|
1732
1746
|
get(params: GetPromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
|
|
1733
1747
|
/**
|
|
1734
|
-
* Create a new promo code. Optionally restrict to specific plans.
|
|
1748
|
+
* Create a new promo code. Optionally restrict it to specific plans and a billing interval.
|
|
1735
1749
|
*
|
|
1736
1750
|
* **100% discounts are not supported.** Percentage codes must be strictly less than 100% (`discountValue` < 10000 basis points). For full waivers, use an introductory offer on the plan instead. At checkout, any code — percentage or fixed amount — that would reduce the total below the currency's minimum charge ($0.50 USD equivalent) is silently dropped.
|
|
1737
1751
|
*/
|
|
1738
1752
|
create(params: CreatePromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
|
|
1739
|
-
/** Update a promo code's redemption limits, expiration, active status, or plan restrictions. */
|
|
1753
|
+
/** Update a promo code's billing interval, redemption limits, expiration, active status, or plan restrictions. */
|
|
1740
1754
|
update(params: UpdatePromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
|
|
1741
1755
|
}
|
|
1742
1756
|
|
|
1757
|
+
declare class ProvisioningResource {
|
|
1758
|
+
private httpClient;
|
|
1759
|
+
constructor(httpClient: CommetHTTPClient);
|
|
1760
|
+
/** Issue a fresh claim link for an organization that was provisioned headlessly and has not been claimed yet. Any previously issued link stops working. */
|
|
1761
|
+
createClaimLink(options?: RequestOptions): Promise<ApiResponse<ClaimLink>>;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1743
1764
|
interface AddQuotaParams {
|
|
1744
1765
|
customerId?: string;
|
|
1745
1766
|
externalId?: string;
|
|
@@ -1843,6 +1864,9 @@ interface CreateSubscriptionParams {
|
|
|
1843
1864
|
discountValue: number;
|
|
1844
1865
|
durationCycles: number;
|
|
1845
1866
|
};
|
|
1867
|
+
promoCode?: string;
|
|
1868
|
+
/** Payment provider for the initial checkout. Overrides country routing when present. */
|
|
1869
|
+
provider?: PaymentProvider;
|
|
1846
1870
|
name?: string;
|
|
1847
1871
|
/** @format date-time */
|
|
1848
1872
|
startDate?: string;
|
|
@@ -1954,8 +1978,8 @@ declare class TestClockResource {
|
|
|
1954
1978
|
get(): Promise<ApiResponse<TestClock>>;
|
|
1955
1979
|
/** Moves the test clock forward, by a number of days (advanceDays) or to an absolute instant (frozenTime). The clock can only move forward. Sandbox only. */
|
|
1956
1980
|
advance(params?: AdvanceTestClockParams, options?: RequestOptions): Promise<ApiResponse<TestClock>>;
|
|
1957
|
-
/** Discovers customers due for billing at the org's current (simulated) time and enqueues a billing cycle for each — renewals, expired trials, pending cancellations. Enqueueing is asynchronous. Sandbox only. */
|
|
1958
|
-
processBilling(): Promise<ApiResponse<TestClockBilling>>;
|
|
1981
|
+
/** Discovers customers due for billing at the org's current (simulated) time and enqueues a billing cycle for each — renewals, expired trials, pending cancellations. Also fires any dunning retry whose scheduled time has passed. Enqueueing is asynchronous. Sandbox only. */
|
|
1982
|
+
processBilling(options?: RequestOptions): Promise<ApiResponse<TestClockBilling>>;
|
|
1959
1983
|
}
|
|
1960
1984
|
|
|
1961
1985
|
interface ListTransactionsParams {
|
|
@@ -2000,6 +2024,7 @@ declare class GeneratedResources {
|
|
|
2000
2024
|
plans: PlansResource;
|
|
2001
2025
|
portal: PortalResource;
|
|
2002
2026
|
promoCodes: PromoCodesResource;
|
|
2027
|
+
provisioning: ProvisioningResource;
|
|
2003
2028
|
quota: QuotaResource;
|
|
2004
2029
|
seats: SeatsResource;
|
|
2005
2030
|
subscriptions: SubscriptionsResource;
|
|
@@ -2053,6 +2078,27 @@ interface CheckUsageParams {
|
|
|
2053
2078
|
featureCode: string;
|
|
2054
2079
|
quantity: number;
|
|
2055
2080
|
}
|
|
2081
|
+
interface SetUsageParams {
|
|
2082
|
+
customerId: CustomerID;
|
|
2083
|
+
feature: string;
|
|
2084
|
+
value: number;
|
|
2085
|
+
idempotencyKey?: string;
|
|
2086
|
+
reason?: string;
|
|
2087
|
+
}
|
|
2088
|
+
interface UsageAdjustment {
|
|
2089
|
+
id: EventID;
|
|
2090
|
+
feature: string;
|
|
2091
|
+
value: number;
|
|
2092
|
+
previousValue: number;
|
|
2093
|
+
adjustment: number;
|
|
2094
|
+
customerId: CustomerID;
|
|
2095
|
+
idempotencyKey: string | null;
|
|
2096
|
+
reason: string | null;
|
|
2097
|
+
ts: string;
|
|
2098
|
+
createdAt: string;
|
|
2099
|
+
object: "usage_event";
|
|
2100
|
+
livemode: boolean;
|
|
2101
|
+
}
|
|
2056
2102
|
interface UsageCheckResult {
|
|
2057
2103
|
allowed: boolean;
|
|
2058
2104
|
consumptionModel: ConsumptionModel;
|
|
@@ -2084,6 +2130,8 @@ declare class UsageResource {
|
|
|
2084
2130
|
track(params: TrackParams, options?: RequestOptions): Promise<ApiResponse<UsageEvent>>;
|
|
2085
2131
|
/** Dry-run: checks if a usage event would be allowed without actually tracking it. */
|
|
2086
2132
|
check(params: CheckUsageParams, options?: RequestOptions): Promise<ApiResponse<UsageCheckResult>>;
|
|
2133
|
+
/** Set a metered feature's usage to an exact value for the current period. */
|
|
2134
|
+
set(params: SetUsageParams, options?: RequestOptions): Promise<ApiResponse<UsageAdjustment>>;
|
|
2087
2135
|
}
|
|
2088
2136
|
|
|
2089
2137
|
type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
|
|
@@ -2154,7 +2202,7 @@ interface SubscriptionReactivatedData {
|
|
|
2154
2202
|
/** The payment provider that processed the reactivation charge: stripe, commet, or dlocal. */
|
|
2155
2203
|
provider: PaymentProvider;
|
|
2156
2204
|
}
|
|
2157
|
-
/** Fired when a subscription is actually terminated at the end of the billing period. The status is now canceled and access should be revoked. This event is NOT fired when cancellation is scheduled — that triggers subscription.updated instead. See the cancellation lifecycle below. */
|
|
2205
|
+
/** Fired when a subscription is actually terminated. A scheduled cancellation fires it at the end of the billing period; immediate cancellations, full refunds (cancelReason refund), and exhausted dunning retries (cancelReason dunning_exhausted) fire it right away. The status is now canceled and access should be revoked. This event is NOT fired when cancellation is scheduled — that triggers subscription.updated instead. See the cancellation lifecycle below. */
|
|
2158
2206
|
interface SubscriptionCanceledData {
|
|
2159
2207
|
/** The subscription ID. */
|
|
2160
2208
|
subscriptionId: string;
|
|
@@ -2162,11 +2210,11 @@ interface SubscriptionCanceledData {
|
|
|
2162
2210
|
customerId: string;
|
|
2163
2211
|
/** Always "canceled" for this event. Revoke access when you receive this. */
|
|
2164
2212
|
status: string;
|
|
2165
|
-
/** ISO 8601 datetime when the
|
|
2213
|
+
/** ISO 8601 datetime when the cancellation was requested or triggered. */
|
|
2166
2214
|
canceledAt?: string;
|
|
2167
|
-
/** The reason for cancellation, if provided. */
|
|
2215
|
+
/** The reason for cancellation, if provided. Set by Commet on system-initiated terminations: "refund" (full refund of a subscription invoice) or "dunning_exhausted" (all payment retries failed). */
|
|
2168
2216
|
cancelReason: string | null;
|
|
2169
|
-
/** ISO 8601 datetime when the subscription ended
|
|
2217
|
+
/** ISO 8601 datetime when the subscription ended. Matches the billing period end for scheduled cancellations; for immediate terminations it is the moment of termination. */
|
|
2170
2218
|
endDate?: string;
|
|
2171
2219
|
}
|
|
2172
2220
|
/** Fired when subscription details change. The most common trigger is scheduling a cancellation — when a customer cancels, the status stays "active" until the billing period ends, but canceledAt and endDate are set immediately. Use this event to show "your subscription will end on {endDate}" in your UI. Access should NOT be revoked here — wait for subscription.canceled. */
|
|
@@ -3216,4 +3264,4 @@ declare function registerIntegration(name: string, version: string): void;
|
|
|
3216
3264
|
declare const API_VERSION = "2026-07-11";
|
|
3217
3265
|
declare const SDK_VERSION: string;
|
|
3218
3266
|
|
|
3219
|
-
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelPaymentParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type ChargePaymentParams, type CheckUsageParams, type CheckoutReadyData, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePaymentParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Currency, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerID, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DefaultPlanPrice, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookParams, type DeletedObject, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DiscountType, type DownloadInvoiceParams, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureLookup, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceOverdueData, type InvoiceStatus, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPaymentsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type PayoutVerification, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGroup, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PlanVisibility, type PortalAccess, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatBalanceListItem, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionPastDueData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionStatus, type SubscriptionUpdatedData, type TestClock, type TestClockBilling, type TestWebhookParams, type Timezone, type TopupBalanceParams, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type Transaction, type TransactionRefund, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UpsertRegionalPricesParams, type UsageCheckDenialReason, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookFeatureAccess, type WebhookPayload, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
|
3267
|
+
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelPaymentParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type ChargePaymentParams, type CheckUsageParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePaymentParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Currency, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerID, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DefaultPlanPrice, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookParams, type DeletedObject, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DiscountType, type DownloadInvoiceParams, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureLookup, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceOverdueData, type InvoiceStatus, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPaymentsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type PayoutVerification, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGroup, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PlanVisibility, type PortalAccess, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatBalanceListItem, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type SetUsageParams, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionPastDueData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionStatus, type SubscriptionUpdatedData, type TestClock, type TestClockBilling, type TestWebhookParams, type Timezone, type TopupBalanceParams, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type Transaction, type TransactionRefund, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheckDenialReason, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookFeatureAccess, type WebhookPayload, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
package/dist/index.d.ts
CHANGED
|
@@ -233,6 +233,13 @@ interface CanceledSubscription {
|
|
|
233
233
|
object: "subscription";
|
|
234
234
|
livemode: boolean;
|
|
235
235
|
}
|
|
236
|
+
interface ClaimLink {
|
|
237
|
+
url: string;
|
|
238
|
+
/** @format date-time */
|
|
239
|
+
expiresAt: string;
|
|
240
|
+
object: "claim_link";
|
|
241
|
+
livemode: boolean;
|
|
242
|
+
}
|
|
236
243
|
interface CreatedApiKey {
|
|
237
244
|
id: string;
|
|
238
245
|
name: string;
|
|
@@ -749,6 +756,7 @@ interface PromoCode {
|
|
|
749
756
|
discountType: DiscountType;
|
|
750
757
|
discountValue: number;
|
|
751
758
|
durationCycles: number | null;
|
|
759
|
+
billingInterval: BillingInterval | null;
|
|
752
760
|
maxRedemptions: number | null;
|
|
753
761
|
expiresAt: string | null;
|
|
754
762
|
isActive: boolean;
|
|
@@ -891,6 +899,8 @@ interface Subscription {
|
|
|
891
899
|
billingDayOfMonth: number | null;
|
|
892
900
|
nextBillingDate: string | null;
|
|
893
901
|
checkoutUrl: string | null;
|
|
902
|
+
/** Payment provider resolved for this checkout when the subscription response was created. This is an informational snapshot and may differ when the checkout is loaded if its country or the organization's routing changes. */
|
|
903
|
+
checkoutProvider?: PaymentProvider | null;
|
|
894
904
|
/** @format date-time */
|
|
895
905
|
createdAt: string;
|
|
896
906
|
/** @format date-time */
|
|
@@ -917,6 +927,8 @@ interface TestClockBilling {
|
|
|
917
927
|
customersFound: number;
|
|
918
928
|
enqueued: number;
|
|
919
929
|
failed: number;
|
|
930
|
+
dunningRetried: number;
|
|
931
|
+
dunningFailed: number;
|
|
920
932
|
object: "test_clock";
|
|
921
933
|
livemode: boolean;
|
|
922
934
|
}
|
|
@@ -1628,7 +1640,7 @@ interface UpsertRegionalPricesParams {
|
|
|
1628
1640
|
}
|
|
1629
1641
|
interface SetPlanRegionalPricingParams {
|
|
1630
1642
|
id: string;
|
|
1631
|
-
currency: "ars" | "brl" | "clp" | "cop" | "pen" | "uyu" | "pyg" | "bob" | "mxn" | "cad" | "eur" | "jpy" | "cny" | "krw" | "hkd" | "sgd" | "twd" | "inr" | "thb";
|
|
1643
|
+
currency: "usd" | "ars" | "brl" | "clp" | "cop" | "pen" | "uyu" | "pyg" | "bob" | "mxn" | "cad" | "eur" | "jpy" | "cny" | "krw" | "hkd" | "sgd" | "twd" | "inr" | "thb";
|
|
1632
1644
|
exchangeRate: number;
|
|
1633
1645
|
prices?: Array<{
|
|
1634
1646
|
priceId: string;
|
|
@@ -1681,7 +1693,7 @@ declare class PlansResource {
|
|
|
1681
1693
|
setDefaultPrice(params: SetDefaultPlanPriceParams, options?: RequestOptions): Promise<ApiResponse<DefaultPlanPrice>>;
|
|
1682
1694
|
/** Create or update regional currency price overrides for a plan price. */
|
|
1683
1695
|
setRegionalPrices(params: UpsertRegionalPricesParams, options?: RequestOptions): Promise<ApiResponse<PlanRegionalPricing>>;
|
|
1684
|
-
/** Configure a plan's regional pricing for one currency. Sending only currency and exchangeRate derives every regional value (base price, included balance, feature overage, intro offer) from the USD value
|
|
1696
|
+
/** Configure a plan's regional pricing for one currency. USD configures the United States variant; exchangeRate acts as its price multiplier. Sending only currency and exchangeRate derives every regional value (base price, included balance, feature overage, intro offer) from the default USD value. Optional per-price and per-feature overrides are stored as manual values. */
|
|
1685
1697
|
setRegionalPricing(params: SetPlanRegionalPricingParams, options?: RequestOptions): Promise<ApiResponse<PlanRegionalPricingResult>>;
|
|
1686
1698
|
/** Remove all regional currency overrides for a plan price. */
|
|
1687
1699
|
deleteRegionalPrices(params: DeleteRegionalPricesParams, options?: RequestOptions): Promise<ApiResponse<DeletedPlanRegionalPricing>>;
|
|
@@ -1711,6 +1723,7 @@ interface CreatePromoCodeParams {
|
|
|
1711
1723
|
discountType: DiscountType;
|
|
1712
1724
|
discountValue: number;
|
|
1713
1725
|
durationCycles?: number;
|
|
1726
|
+
billingInterval?: BillingInterval | null;
|
|
1714
1727
|
maxRedemptions?: number;
|
|
1715
1728
|
/** @format date-time */
|
|
1716
1729
|
expiresAt?: string;
|
|
@@ -1718,6 +1731,7 @@ interface CreatePromoCodeParams {
|
|
|
1718
1731
|
}
|
|
1719
1732
|
interface UpdatePromoCodeParams {
|
|
1720
1733
|
id: string;
|
|
1734
|
+
billingInterval?: BillingInterval | null;
|
|
1721
1735
|
maxRedemptions?: number | null;
|
|
1722
1736
|
expiresAt?: string | null;
|
|
1723
1737
|
active?: boolean;
|
|
@@ -1731,15 +1745,22 @@ declare class PromoCodesResource {
|
|
|
1731
1745
|
/** Retrieve a promo code by its public ID. */
|
|
1732
1746
|
get(params: GetPromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
|
|
1733
1747
|
/**
|
|
1734
|
-
* Create a new promo code. Optionally restrict to specific plans.
|
|
1748
|
+
* Create a new promo code. Optionally restrict it to specific plans and a billing interval.
|
|
1735
1749
|
*
|
|
1736
1750
|
* **100% discounts are not supported.** Percentage codes must be strictly less than 100% (`discountValue` < 10000 basis points). For full waivers, use an introductory offer on the plan instead. At checkout, any code — percentage or fixed amount — that would reduce the total below the currency's minimum charge ($0.50 USD equivalent) is silently dropped.
|
|
1737
1751
|
*/
|
|
1738
1752
|
create(params: CreatePromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
|
|
1739
|
-
/** Update a promo code's redemption limits, expiration, active status, or plan restrictions. */
|
|
1753
|
+
/** Update a promo code's billing interval, redemption limits, expiration, active status, or plan restrictions. */
|
|
1740
1754
|
update(params: UpdatePromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
|
|
1741
1755
|
}
|
|
1742
1756
|
|
|
1757
|
+
declare class ProvisioningResource {
|
|
1758
|
+
private httpClient;
|
|
1759
|
+
constructor(httpClient: CommetHTTPClient);
|
|
1760
|
+
/** Issue a fresh claim link for an organization that was provisioned headlessly and has not been claimed yet. Any previously issued link stops working. */
|
|
1761
|
+
createClaimLink(options?: RequestOptions): Promise<ApiResponse<ClaimLink>>;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1743
1764
|
interface AddQuotaParams {
|
|
1744
1765
|
customerId?: string;
|
|
1745
1766
|
externalId?: string;
|
|
@@ -1843,6 +1864,9 @@ interface CreateSubscriptionParams {
|
|
|
1843
1864
|
discountValue: number;
|
|
1844
1865
|
durationCycles: number;
|
|
1845
1866
|
};
|
|
1867
|
+
promoCode?: string;
|
|
1868
|
+
/** Payment provider for the initial checkout. Overrides country routing when present. */
|
|
1869
|
+
provider?: PaymentProvider;
|
|
1846
1870
|
name?: string;
|
|
1847
1871
|
/** @format date-time */
|
|
1848
1872
|
startDate?: string;
|
|
@@ -1954,8 +1978,8 @@ declare class TestClockResource {
|
|
|
1954
1978
|
get(): Promise<ApiResponse<TestClock>>;
|
|
1955
1979
|
/** Moves the test clock forward, by a number of days (advanceDays) or to an absolute instant (frozenTime). The clock can only move forward. Sandbox only. */
|
|
1956
1980
|
advance(params?: AdvanceTestClockParams, options?: RequestOptions): Promise<ApiResponse<TestClock>>;
|
|
1957
|
-
/** Discovers customers due for billing at the org's current (simulated) time and enqueues a billing cycle for each — renewals, expired trials, pending cancellations. Enqueueing is asynchronous. Sandbox only. */
|
|
1958
|
-
processBilling(): Promise<ApiResponse<TestClockBilling>>;
|
|
1981
|
+
/** Discovers customers due for billing at the org's current (simulated) time and enqueues a billing cycle for each — renewals, expired trials, pending cancellations. Also fires any dunning retry whose scheduled time has passed. Enqueueing is asynchronous. Sandbox only. */
|
|
1982
|
+
processBilling(options?: RequestOptions): Promise<ApiResponse<TestClockBilling>>;
|
|
1959
1983
|
}
|
|
1960
1984
|
|
|
1961
1985
|
interface ListTransactionsParams {
|
|
@@ -2000,6 +2024,7 @@ declare class GeneratedResources {
|
|
|
2000
2024
|
plans: PlansResource;
|
|
2001
2025
|
portal: PortalResource;
|
|
2002
2026
|
promoCodes: PromoCodesResource;
|
|
2027
|
+
provisioning: ProvisioningResource;
|
|
2003
2028
|
quota: QuotaResource;
|
|
2004
2029
|
seats: SeatsResource;
|
|
2005
2030
|
subscriptions: SubscriptionsResource;
|
|
@@ -2053,6 +2078,27 @@ interface CheckUsageParams {
|
|
|
2053
2078
|
featureCode: string;
|
|
2054
2079
|
quantity: number;
|
|
2055
2080
|
}
|
|
2081
|
+
interface SetUsageParams {
|
|
2082
|
+
customerId: CustomerID;
|
|
2083
|
+
feature: string;
|
|
2084
|
+
value: number;
|
|
2085
|
+
idempotencyKey?: string;
|
|
2086
|
+
reason?: string;
|
|
2087
|
+
}
|
|
2088
|
+
interface UsageAdjustment {
|
|
2089
|
+
id: EventID;
|
|
2090
|
+
feature: string;
|
|
2091
|
+
value: number;
|
|
2092
|
+
previousValue: number;
|
|
2093
|
+
adjustment: number;
|
|
2094
|
+
customerId: CustomerID;
|
|
2095
|
+
idempotencyKey: string | null;
|
|
2096
|
+
reason: string | null;
|
|
2097
|
+
ts: string;
|
|
2098
|
+
createdAt: string;
|
|
2099
|
+
object: "usage_event";
|
|
2100
|
+
livemode: boolean;
|
|
2101
|
+
}
|
|
2056
2102
|
interface UsageCheckResult {
|
|
2057
2103
|
allowed: boolean;
|
|
2058
2104
|
consumptionModel: ConsumptionModel;
|
|
@@ -2084,6 +2130,8 @@ declare class UsageResource {
|
|
|
2084
2130
|
track(params: TrackParams, options?: RequestOptions): Promise<ApiResponse<UsageEvent>>;
|
|
2085
2131
|
/** Dry-run: checks if a usage event would be allowed without actually tracking it. */
|
|
2086
2132
|
check(params: CheckUsageParams, options?: RequestOptions): Promise<ApiResponse<UsageCheckResult>>;
|
|
2133
|
+
/** Set a metered feature's usage to an exact value for the current period. */
|
|
2134
|
+
set(params: SetUsageParams, options?: RequestOptions): Promise<ApiResponse<UsageAdjustment>>;
|
|
2087
2135
|
}
|
|
2088
2136
|
|
|
2089
2137
|
type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
|
|
@@ -2154,7 +2202,7 @@ interface SubscriptionReactivatedData {
|
|
|
2154
2202
|
/** The payment provider that processed the reactivation charge: stripe, commet, or dlocal. */
|
|
2155
2203
|
provider: PaymentProvider;
|
|
2156
2204
|
}
|
|
2157
|
-
/** Fired when a subscription is actually terminated at the end of the billing period. The status is now canceled and access should be revoked. This event is NOT fired when cancellation is scheduled — that triggers subscription.updated instead. See the cancellation lifecycle below. */
|
|
2205
|
+
/** Fired when a subscription is actually terminated. A scheduled cancellation fires it at the end of the billing period; immediate cancellations, full refunds (cancelReason refund), and exhausted dunning retries (cancelReason dunning_exhausted) fire it right away. The status is now canceled and access should be revoked. This event is NOT fired when cancellation is scheduled — that triggers subscription.updated instead. See the cancellation lifecycle below. */
|
|
2158
2206
|
interface SubscriptionCanceledData {
|
|
2159
2207
|
/** The subscription ID. */
|
|
2160
2208
|
subscriptionId: string;
|
|
@@ -2162,11 +2210,11 @@ interface SubscriptionCanceledData {
|
|
|
2162
2210
|
customerId: string;
|
|
2163
2211
|
/** Always "canceled" for this event. Revoke access when you receive this. */
|
|
2164
2212
|
status: string;
|
|
2165
|
-
/** ISO 8601 datetime when the
|
|
2213
|
+
/** ISO 8601 datetime when the cancellation was requested or triggered. */
|
|
2166
2214
|
canceledAt?: string;
|
|
2167
|
-
/** The reason for cancellation, if provided. */
|
|
2215
|
+
/** The reason for cancellation, if provided. Set by Commet on system-initiated terminations: "refund" (full refund of a subscription invoice) or "dunning_exhausted" (all payment retries failed). */
|
|
2168
2216
|
cancelReason: string | null;
|
|
2169
|
-
/** ISO 8601 datetime when the subscription ended
|
|
2217
|
+
/** ISO 8601 datetime when the subscription ended. Matches the billing period end for scheduled cancellations; for immediate terminations it is the moment of termination. */
|
|
2170
2218
|
endDate?: string;
|
|
2171
2219
|
}
|
|
2172
2220
|
/** Fired when subscription details change. The most common trigger is scheduling a cancellation — when a customer cancels, the status stays "active" until the billing period ends, but canceledAt and endDate are set immediately. Use this event to show "your subscription will end on {endDate}" in your UI. Access should NOT be revoked here — wait for subscription.canceled. */
|
|
@@ -3216,4 +3264,4 @@ declare function registerIntegration(name: string, version: string): void;
|
|
|
3216
3264
|
declare const API_VERSION = "2026-07-11";
|
|
3217
3265
|
declare const SDK_VERSION: string;
|
|
3218
3266
|
|
|
3219
|
-
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelPaymentParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type ChargePaymentParams, type CheckUsageParams, type CheckoutReadyData, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePaymentParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Currency, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerID, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DefaultPlanPrice, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookParams, type DeletedObject, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DiscountType, type DownloadInvoiceParams, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureLookup, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceOverdueData, type InvoiceStatus, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPaymentsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type PayoutVerification, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGroup, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PlanVisibility, type PortalAccess, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatBalanceListItem, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionPastDueData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionStatus, type SubscriptionUpdatedData, type TestClock, type TestClockBilling, type TestWebhookParams, type Timezone, type TopupBalanceParams, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type Transaction, type TransactionRefund, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UpsertRegionalPricesParams, type UsageCheckDenialReason, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookFeatureAccess, type WebhookPayload, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
|
3267
|
+
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelPaymentParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type ChargePaymentParams, type CheckUsageParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePaymentParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Currency, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerID, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DefaultPlanPrice, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookParams, type DeletedObject, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DiscountType, type DownloadInvoiceParams, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureLookup, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceOverdueData, type InvoiceStatus, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPaymentsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type PayoutVerification, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGroup, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PlanVisibility, type PortalAccess, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatBalanceListItem, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type SetUsageParams, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionPastDueData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionStatus, type SubscriptionUpdatedData, type TestClock, type TestClockBilling, type TestWebhookParams, type Timezone, type TopupBalanceParams, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type Transaction, type TransactionRefund, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheckDenialReason, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookFeatureAccess, type WebhookPayload, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
package/dist/index.js
CHANGED
|
@@ -440,7 +440,7 @@ var PlansResource = class {
|
|
|
440
440
|
options
|
|
441
441
|
);
|
|
442
442
|
}
|
|
443
|
-
/** Configure a plan's regional pricing for one currency. Sending only currency and exchangeRate derives every regional value (base price, included balance, feature overage, intro offer) from the USD value
|
|
443
|
+
/** Configure a plan's regional pricing for one currency. USD configures the United States variant; exchangeRate acts as its price multiplier. Sending only currency and exchangeRate derives every regional value (base price, included balance, feature overage, intro offer) from the default USD value. Optional per-price and per-feature overrides are stored as manual values. */
|
|
444
444
|
async setRegionalPricing(params, options) {
|
|
445
445
|
const { id, ...rest } = params;
|
|
446
446
|
return this.httpClient.put(`/plans/${id}/regional`, rest, options);
|
|
@@ -482,20 +482,31 @@ var PromoCodesResource = class {
|
|
|
482
482
|
return this.httpClient.get(`/promo-codes/${id}`, void 0, options);
|
|
483
483
|
}
|
|
484
484
|
/**
|
|
485
|
-
* Create a new promo code. Optionally restrict to specific plans.
|
|
485
|
+
* Create a new promo code. Optionally restrict it to specific plans and a billing interval.
|
|
486
486
|
*
|
|
487
487
|
* **100% discounts are not supported.** Percentage codes must be strictly less than 100% (`discountValue` < 10000 basis points). For full waivers, use an introductory offer on the plan instead. At checkout, any code — percentage or fixed amount — that would reduce the total below the currency's minimum charge ($0.50 USD equivalent) is silently dropped.
|
|
488
488
|
*/
|
|
489
489
|
async create(params, options) {
|
|
490
490
|
return this.httpClient.post("/promo-codes", params, options);
|
|
491
491
|
}
|
|
492
|
-
/** Update a promo code's redemption limits, expiration, active status, or plan restrictions. */
|
|
492
|
+
/** Update a promo code's billing interval, redemption limits, expiration, active status, or plan restrictions. */
|
|
493
493
|
async update(params, options) {
|
|
494
494
|
const { id, ...rest } = params;
|
|
495
495
|
return this.httpClient.put(`/promo-codes/${id}`, rest, options);
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
498
|
|
|
499
|
+
// src/resources/provisioning.ts
|
|
500
|
+
var ProvisioningResource = class {
|
|
501
|
+
constructor(httpClient) {
|
|
502
|
+
this.httpClient = httpClient;
|
|
503
|
+
}
|
|
504
|
+
/** Issue a fresh claim link for an organization that was provisioned headlessly and has not been claimed yet. Any previously issued link stops working. */
|
|
505
|
+
async createClaimLink(options) {
|
|
506
|
+
return this.httpClient.post("/claim-link", {}, options);
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
|
|
499
510
|
// src/resources/quota.ts
|
|
500
511
|
var QuotaResource = class {
|
|
501
512
|
constructor(httpClient) {
|
|
@@ -679,9 +690,9 @@ var TestClockResource = class {
|
|
|
679
690
|
async advance(params, options) {
|
|
680
691
|
return this.httpClient.post("/test-clock", params, options);
|
|
681
692
|
}
|
|
682
|
-
/** Discovers customers due for billing at the org's current (simulated) time and enqueues a billing cycle for each — renewals, expired trials, pending cancellations. Enqueueing is asynchronous. Sandbox only. */
|
|
683
|
-
async processBilling() {
|
|
684
|
-
return this.httpClient.post("/test-clock/process-billing", {});
|
|
693
|
+
/** Discovers customers due for billing at the org's current (simulated) time and enqueues a billing cycle for each — renewals, expired trials, pending cancellations. Also fires any dunning retry whose scheduled time has passed. Enqueueing is asynchronous. Sandbox only. */
|
|
694
|
+
async processBilling(options) {
|
|
695
|
+
return this.httpClient.post("/test-clock/process-billing", {}, options);
|
|
685
696
|
}
|
|
686
697
|
};
|
|
687
698
|
|
|
@@ -727,6 +738,7 @@ var GeneratedResources = class {
|
|
|
727
738
|
this.plans = new PlansResource(http);
|
|
728
739
|
this.portal = new PortalResource(http);
|
|
729
740
|
this.promoCodes = new PromoCodesResource(http);
|
|
741
|
+
this.provisioning = new ProvisioningResource(http);
|
|
730
742
|
this.quota = new QuotaResource(http);
|
|
731
743
|
this.seats = new SeatsResource(http);
|
|
732
744
|
this.subscriptions = new SubscriptionsResource(http);
|
|
@@ -771,6 +783,10 @@ var UsageResource = class {
|
|
|
771
783
|
async check(params, options) {
|
|
772
784
|
return this.httpClient.post("/usage/check", params, options);
|
|
773
785
|
}
|
|
786
|
+
/** Set a metered feature's usage to an exact value for the current period. */
|
|
787
|
+
async set(params, options) {
|
|
788
|
+
return this.httpClient.put("/usage", params, options);
|
|
789
|
+
}
|
|
774
790
|
};
|
|
775
791
|
|
|
776
792
|
// src/resources/webhooks.ts
|
|
@@ -880,7 +896,7 @@ var CommetValidationError = class extends CommetError {
|
|
|
880
896
|
|
|
881
897
|
// src/version.ts
|
|
882
898
|
var API_VERSION = "2026-07-11";
|
|
883
|
-
var SDK_VERSION = "7.
|
|
899
|
+
var SDK_VERSION = "7.10.0";
|
|
884
900
|
|
|
885
901
|
// src/utils/telemetry.ts
|
|
886
902
|
var registeredIntegrations = /* @__PURE__ */ new Set();
|