@commet/node 6.0.0 → 7.0.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/README.md +5 -5
- package/dist/index.d.mts +32 -11
- package/dist/index.d.ts +32 -11
- package/dist/index.js +28 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,12 +48,12 @@ const commet = new Commet({
|
|
|
48
48
|
// Create a customer
|
|
49
49
|
const customer = await commet.customers.create({
|
|
50
50
|
fullName: 'Acme Corp',
|
|
51
|
-
|
|
51
|
+
email: 'billing@acme.com'
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
// Subscribe them to a plan
|
|
55
55
|
await commet.subscriptions.create({
|
|
56
|
-
|
|
56
|
+
customerId: 'cus_123',
|
|
57
57
|
planCode: 'pro', // autocomplete works after `commet pull`
|
|
58
58
|
billingInterval: 'yearly',
|
|
59
59
|
});
|
|
@@ -86,14 +86,14 @@ const projects = await commet.quota.get({
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
// Check feature access
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const access = await commet.featureAccess.canUse({
|
|
90
|
+
customerId: 'cus_123',
|
|
91
91
|
code: 'api_calls'
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
// Generate customer portal link
|
|
95
95
|
const portal = await commet.portal.getUrl({
|
|
96
|
-
|
|
96
|
+
customerId: 'cus_123'
|
|
97
97
|
});
|
|
98
98
|
```
|
|
99
99
|
|
package/dist/index.d.mts
CHANGED
|
@@ -820,6 +820,14 @@ interface Subscription {
|
|
|
820
820
|
effectiveAt: string;
|
|
821
821
|
} | null;
|
|
822
822
|
cancelAtPeriodEnd: boolean;
|
|
823
|
+
scheduledPlanChange: {
|
|
824
|
+
changeType: "plan_downgrade" | "interval_change";
|
|
825
|
+
newPlanId: string | null;
|
|
826
|
+
newPlanName: string | null;
|
|
827
|
+
newBillingInterval: string | null;
|
|
828
|
+
/** @format date-time */
|
|
829
|
+
scheduledFor: string;
|
|
830
|
+
} | null;
|
|
823
831
|
discount: {
|
|
824
832
|
type: DiscountType;
|
|
825
833
|
value: number;
|
|
@@ -957,7 +965,7 @@ declare class CommetHTTPClient {
|
|
|
957
965
|
}
|
|
958
966
|
|
|
959
967
|
interface ListActiveAddonsParams {
|
|
960
|
-
customerId
|
|
968
|
+
customerId: string;
|
|
961
969
|
}
|
|
962
970
|
interface ListAddonsParams {
|
|
963
971
|
limit?: number;
|
|
@@ -991,7 +999,7 @@ declare class AddonsResource {
|
|
|
991
999
|
private httpClient;
|
|
992
1000
|
constructor(httpClient: CommetHTTPClient);
|
|
993
1001
|
/** List all active add-ons for a customer's subscription. */
|
|
994
|
-
listActive(params
|
|
1002
|
+
listActive(params: ListActiveAddonsParams, options?: RequestOptions): Promise<ApiResponse<Array<ActiveAddon>>>;
|
|
995
1003
|
/** List all add-ons with cursor-based pagination. */
|
|
996
1004
|
list(params?: ListAddonsParams, options?: RequestOptions): Promise<ApiResponse<Array<Addon>>>;
|
|
997
1005
|
/** Retrieve an add-on by its public ID or slug. */
|
|
@@ -1135,7 +1143,7 @@ declare class CustomersResource {
|
|
|
1135
1143
|
createBatch(params: BatchCreateCustomersParams, options?: RequestOptions): Promise<ApiResponse<CustomerBatch>>;
|
|
1136
1144
|
}
|
|
1137
1145
|
|
|
1138
|
-
interface
|
|
1146
|
+
interface ListFeatureAccessParams {
|
|
1139
1147
|
customerId: string;
|
|
1140
1148
|
}
|
|
1141
1149
|
interface GetFeatureAccessParams {
|
|
@@ -1147,6 +1155,20 @@ interface CanUseFeatureParams {
|
|
|
1147
1155
|
code: string;
|
|
1148
1156
|
customerId: string;
|
|
1149
1157
|
}
|
|
1158
|
+
declare class FeatureAccessResource {
|
|
1159
|
+
private httpClient;
|
|
1160
|
+
constructor(httpClient: CommetHTTPClient);
|
|
1161
|
+
/** List all features for a customer's active subscription, scoped by the customerId query parameter. */
|
|
1162
|
+
list(params: ListFeatureAccessParams, options?: RequestOptions): Promise<ApiResponse<Array<FeatureAccess>>>;
|
|
1163
|
+
/** Get feature access details for a customer. Use action=canUse to check if the customer can consume one more unit. */
|
|
1164
|
+
get(params: GetFeatureAccessParams, options?: RequestOptions): Promise<ApiResponse<FeatureLookup>>;
|
|
1165
|
+
/** Get feature access details for a customer. Use action=canUse to check if the customer can consume one more unit. */
|
|
1166
|
+
canUse(params: CanUseFeatureParams, options?: RequestOptions): Promise<ApiResponse<FeatureLookup>>;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
interface GetFeatureParams {
|
|
1170
|
+
code: string;
|
|
1171
|
+
}
|
|
1150
1172
|
interface CreateFeatureParams {
|
|
1151
1173
|
name: string;
|
|
1152
1174
|
code: string;
|
|
@@ -1166,12 +1188,10 @@ interface DeleteFeatureParams {
|
|
|
1166
1188
|
declare class FeaturesResource {
|
|
1167
1189
|
private httpClient;
|
|
1168
1190
|
constructor(httpClient: CommetHTTPClient);
|
|
1169
|
-
/** List
|
|
1170
|
-
list(
|
|
1171
|
-
/** Get
|
|
1172
|
-
get(params:
|
|
1173
|
-
/** Get feature access details. Use action=canUse to check if customer can consume one more unit. */
|
|
1174
|
-
canUse(params: CanUseFeatureParams, options?: RequestOptions): Promise<ApiResponse<FeatureLookup>>;
|
|
1191
|
+
/** List every feature defined in the organization. This is the organization's feature catalog (definitions), not a customer's feature access. */
|
|
1192
|
+
list(): Promise<ApiResponse<Array<Feature>>>;
|
|
1193
|
+
/** Get a single feature definition by code from the organization's feature catalog. */
|
|
1194
|
+
get(params: GetFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
1175
1195
|
/** Create a new feature. Code must be lowercase alphanumeric with underscores. */
|
|
1176
1196
|
create(params: CreateFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
1177
1197
|
/** Update a feature's name, description, or unit name. At least one field must be provided. */
|
|
@@ -1798,6 +1818,7 @@ declare class GeneratedResources {
|
|
|
1798
1818
|
apiKeys: ApiKeysResource;
|
|
1799
1819
|
creditPacks: CreditPacksResource;
|
|
1800
1820
|
customers: CustomersResource;
|
|
1821
|
+
featureAccess: FeatureAccessResource;
|
|
1801
1822
|
features: FeaturesResource;
|
|
1802
1823
|
invoices: InvoicesResource;
|
|
1803
1824
|
payouts: PayoutsResource;
|
|
@@ -2012,7 +2033,7 @@ declare function createCommet<const TConfig extends BillingConfig>(_billingConfi
|
|
|
2012
2033
|
|
|
2013
2034
|
declare function registerIntegration(name: string, version: string): void;
|
|
2014
2035
|
|
|
2015
|
-
declare const API_VERSION = "2026-06-
|
|
2036
|
+
declare const API_VERSION = "2026-06-10";
|
|
2016
2037
|
declare const SDK_VERSION: string;
|
|
2017
2038
|
|
|
2018
|
-
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type CheckUsageParams, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type Currency, type Customer, type CustomerBatch, type CustomerID, 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 GetInvoiceParams, 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 InvoiceDownload, type InvoiceStatus, type InvoiceType, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type
|
|
2039
|
+
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type CheckUsageParams, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type Currency, type Customer, type CustomerBatch, type CustomerID, 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 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 InvoiceDownload, type InvoiceStatus, type InvoiceType, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payout, type PayoutBankAccount, 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 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 SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type Subscription, type SubscriptionAddon, type SubscriptionStatus, 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 UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, 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 WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookPayload, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
package/dist/index.d.ts
CHANGED
|
@@ -820,6 +820,14 @@ interface Subscription {
|
|
|
820
820
|
effectiveAt: string;
|
|
821
821
|
} | null;
|
|
822
822
|
cancelAtPeriodEnd: boolean;
|
|
823
|
+
scheduledPlanChange: {
|
|
824
|
+
changeType: "plan_downgrade" | "interval_change";
|
|
825
|
+
newPlanId: string | null;
|
|
826
|
+
newPlanName: string | null;
|
|
827
|
+
newBillingInterval: string | null;
|
|
828
|
+
/** @format date-time */
|
|
829
|
+
scheduledFor: string;
|
|
830
|
+
} | null;
|
|
823
831
|
discount: {
|
|
824
832
|
type: DiscountType;
|
|
825
833
|
value: number;
|
|
@@ -957,7 +965,7 @@ declare class CommetHTTPClient {
|
|
|
957
965
|
}
|
|
958
966
|
|
|
959
967
|
interface ListActiveAddonsParams {
|
|
960
|
-
customerId
|
|
968
|
+
customerId: string;
|
|
961
969
|
}
|
|
962
970
|
interface ListAddonsParams {
|
|
963
971
|
limit?: number;
|
|
@@ -991,7 +999,7 @@ declare class AddonsResource {
|
|
|
991
999
|
private httpClient;
|
|
992
1000
|
constructor(httpClient: CommetHTTPClient);
|
|
993
1001
|
/** List all active add-ons for a customer's subscription. */
|
|
994
|
-
listActive(params
|
|
1002
|
+
listActive(params: ListActiveAddonsParams, options?: RequestOptions): Promise<ApiResponse<Array<ActiveAddon>>>;
|
|
995
1003
|
/** List all add-ons with cursor-based pagination. */
|
|
996
1004
|
list(params?: ListAddonsParams, options?: RequestOptions): Promise<ApiResponse<Array<Addon>>>;
|
|
997
1005
|
/** Retrieve an add-on by its public ID or slug. */
|
|
@@ -1135,7 +1143,7 @@ declare class CustomersResource {
|
|
|
1135
1143
|
createBatch(params: BatchCreateCustomersParams, options?: RequestOptions): Promise<ApiResponse<CustomerBatch>>;
|
|
1136
1144
|
}
|
|
1137
1145
|
|
|
1138
|
-
interface
|
|
1146
|
+
interface ListFeatureAccessParams {
|
|
1139
1147
|
customerId: string;
|
|
1140
1148
|
}
|
|
1141
1149
|
interface GetFeatureAccessParams {
|
|
@@ -1147,6 +1155,20 @@ interface CanUseFeatureParams {
|
|
|
1147
1155
|
code: string;
|
|
1148
1156
|
customerId: string;
|
|
1149
1157
|
}
|
|
1158
|
+
declare class FeatureAccessResource {
|
|
1159
|
+
private httpClient;
|
|
1160
|
+
constructor(httpClient: CommetHTTPClient);
|
|
1161
|
+
/** List all features for a customer's active subscription, scoped by the customerId query parameter. */
|
|
1162
|
+
list(params: ListFeatureAccessParams, options?: RequestOptions): Promise<ApiResponse<Array<FeatureAccess>>>;
|
|
1163
|
+
/** Get feature access details for a customer. Use action=canUse to check if the customer can consume one more unit. */
|
|
1164
|
+
get(params: GetFeatureAccessParams, options?: RequestOptions): Promise<ApiResponse<FeatureLookup>>;
|
|
1165
|
+
/** Get feature access details for a customer. Use action=canUse to check if the customer can consume one more unit. */
|
|
1166
|
+
canUse(params: CanUseFeatureParams, options?: RequestOptions): Promise<ApiResponse<FeatureLookup>>;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
interface GetFeatureParams {
|
|
1170
|
+
code: string;
|
|
1171
|
+
}
|
|
1150
1172
|
interface CreateFeatureParams {
|
|
1151
1173
|
name: string;
|
|
1152
1174
|
code: string;
|
|
@@ -1166,12 +1188,10 @@ interface DeleteFeatureParams {
|
|
|
1166
1188
|
declare class FeaturesResource {
|
|
1167
1189
|
private httpClient;
|
|
1168
1190
|
constructor(httpClient: CommetHTTPClient);
|
|
1169
|
-
/** List
|
|
1170
|
-
list(
|
|
1171
|
-
/** Get
|
|
1172
|
-
get(params:
|
|
1173
|
-
/** Get feature access details. Use action=canUse to check if customer can consume one more unit. */
|
|
1174
|
-
canUse(params: CanUseFeatureParams, options?: RequestOptions): Promise<ApiResponse<FeatureLookup>>;
|
|
1191
|
+
/** List every feature defined in the organization. This is the organization's feature catalog (definitions), not a customer's feature access. */
|
|
1192
|
+
list(): Promise<ApiResponse<Array<Feature>>>;
|
|
1193
|
+
/** Get a single feature definition by code from the organization's feature catalog. */
|
|
1194
|
+
get(params: GetFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
1175
1195
|
/** Create a new feature. Code must be lowercase alphanumeric with underscores. */
|
|
1176
1196
|
create(params: CreateFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
1177
1197
|
/** Update a feature's name, description, or unit name. At least one field must be provided. */
|
|
@@ -1798,6 +1818,7 @@ declare class GeneratedResources {
|
|
|
1798
1818
|
apiKeys: ApiKeysResource;
|
|
1799
1819
|
creditPacks: CreditPacksResource;
|
|
1800
1820
|
customers: CustomersResource;
|
|
1821
|
+
featureAccess: FeatureAccessResource;
|
|
1801
1822
|
features: FeaturesResource;
|
|
1802
1823
|
invoices: InvoicesResource;
|
|
1803
1824
|
payouts: PayoutsResource;
|
|
@@ -2012,7 +2033,7 @@ declare function createCommet<const TConfig extends BillingConfig>(_billingConfi
|
|
|
2012
2033
|
|
|
2013
2034
|
declare function registerIntegration(name: string, version: string): void;
|
|
2014
2035
|
|
|
2015
|
-
declare const API_VERSION = "2026-06-
|
|
2036
|
+
declare const API_VERSION = "2026-06-10";
|
|
2016
2037
|
declare const SDK_VERSION: string;
|
|
2017
2038
|
|
|
2018
|
-
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type CheckUsageParams, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type Currency, type Customer, type CustomerBatch, type CustomerID, 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 GetInvoiceParams, 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 InvoiceDownload, type InvoiceStatus, type InvoiceType, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type
|
|
2039
|
+
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApiResponse, type BalanceAdjustment, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type CheckUsageParams, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type Currency, type Customer, type CustomerBatch, type CustomerID, 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 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 InvoiceDownload, type InvoiceStatus, type InvoiceType, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payout, type PayoutBankAccount, 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 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 SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type Subscription, type SubscriptionAddon, type SubscriptionStatus, 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 UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, 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 WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookPayload, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ var AddonsResource = class {
|
|
|
51
51
|
}
|
|
52
52
|
/** List all active add-ons for a customer's subscription. */
|
|
53
53
|
async listActive(params, options) {
|
|
54
|
-
return this.httpClient.get("/addons
|
|
54
|
+
return this.httpClient.get("/active-addons", params, options);
|
|
55
55
|
}
|
|
56
56
|
/** List all add-ons with cursor-based pagination. */
|
|
57
57
|
async list(params, options) {
|
|
@@ -152,29 +152,45 @@ var CustomersResource = class {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
// src/resources/
|
|
156
|
-
var
|
|
155
|
+
// src/resources/feature-access.ts
|
|
156
|
+
var FeatureAccessResource = class {
|
|
157
157
|
constructor(httpClient) {
|
|
158
158
|
this.httpClient = httpClient;
|
|
159
159
|
}
|
|
160
|
-
/** List all features for a customer's active subscription. */
|
|
160
|
+
/** List all features for a customer's active subscription, scoped by the customerId query parameter. */
|
|
161
161
|
async list(params, options) {
|
|
162
|
-
return this.httpClient.get("/
|
|
162
|
+
return this.httpClient.get("/feature-access", params, options);
|
|
163
163
|
}
|
|
164
|
-
/** Get feature access details. Use action=canUse to check if customer can consume one more unit. */
|
|
164
|
+
/** Get feature access details for a customer. Use action=canUse to check if the customer can consume one more unit. */
|
|
165
165
|
async get(params, options) {
|
|
166
166
|
const { code, ...rest } = params;
|
|
167
|
-
return this.httpClient.get(`/
|
|
167
|
+
return this.httpClient.get(`/feature-access/${code}`, rest, options);
|
|
168
168
|
}
|
|
169
|
-
/** Get feature access details. Use action=canUse to check if customer can consume one more unit. */
|
|
169
|
+
/** Get feature access details for a customer. Use action=canUse to check if the customer can consume one more unit. */
|
|
170
170
|
async canUse(params, options) {
|
|
171
171
|
const { code, ...rest } = params;
|
|
172
172
|
return this.httpClient.get(
|
|
173
|
-
`/
|
|
173
|
+
`/feature-access/${code}`,
|
|
174
174
|
{ ...rest, action: "canUse" },
|
|
175
175
|
options
|
|
176
176
|
);
|
|
177
177
|
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// src/resources/features.ts
|
|
181
|
+
var FeaturesResource = class {
|
|
182
|
+
constructor(httpClient) {
|
|
183
|
+
this.httpClient = httpClient;
|
|
184
|
+
}
|
|
185
|
+
/** List every feature defined in the organization. This is the organization's feature catalog (definitions), not a customer's feature access. */
|
|
186
|
+
async list() {
|
|
187
|
+
return this.httpClient.get("/features");
|
|
188
|
+
}
|
|
189
|
+
/** Get a single feature definition by code from the organization's feature catalog. */
|
|
190
|
+
async get(params, options) {
|
|
191
|
+
const { code } = params;
|
|
192
|
+
return this.httpClient.get(`/features/${code}`, void 0, options);
|
|
193
|
+
}
|
|
178
194
|
/** Create a new feature. Code must be lowercase alphanumeric with underscores. */
|
|
179
195
|
async create(params, options) {
|
|
180
196
|
return this.httpClient.post("/features/manage", params, options);
|
|
@@ -646,6 +662,7 @@ var GeneratedResources = class {
|
|
|
646
662
|
this.apiKeys = new ApiKeysResource(http);
|
|
647
663
|
this.creditPacks = new CreditPacksResource(http);
|
|
648
664
|
this.customers = new CustomersResource(http);
|
|
665
|
+
this.featureAccess = new FeatureAccessResource(http);
|
|
649
666
|
this.features = new FeaturesResource(http);
|
|
650
667
|
this.invoices = new InvoicesResource(http);
|
|
651
668
|
this.payouts = new PayoutsResource(http);
|
|
@@ -792,8 +809,8 @@ var CommetValidationError = class extends CommetError {
|
|
|
792
809
|
};
|
|
793
810
|
|
|
794
811
|
// src/version.ts
|
|
795
|
-
var API_VERSION = "2026-06-
|
|
796
|
-
var SDK_VERSION = "
|
|
812
|
+
var API_VERSION = "2026-06-10";
|
|
813
|
+
var SDK_VERSION = "7.0.0";
|
|
797
814
|
|
|
798
815
|
// src/utils/telemetry.ts
|
|
799
816
|
var registeredIntegrations = /* @__PURE__ */ new Set();
|