@commet/node 5.1.0 → 5.2.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 +13 -0
- package/dist/index.d.mts +315 -262
- package/dist/index.d.ts +315 -262
- package/dist/index.js +77 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -441,268 +441,9 @@ declare class CustomersResource {
|
|
|
441
441
|
list(params?: ListCustomersParams): Promise<ApiResponse<Customer[]>>;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
interface GetFeatureParams {
|
|
445
|
-
customerId: CustomerID;
|
|
446
|
-
code: string;
|
|
447
|
-
}
|
|
448
|
-
interface CanUseFeatureParams {
|
|
449
|
-
customerId: CustomerID;
|
|
450
|
-
code: string;
|
|
451
|
-
}
|
|
452
|
-
interface ListFeaturesParams {
|
|
453
|
-
customerId: CustomerID;
|
|
454
|
-
}
|
|
455
|
-
interface FeatureAccess {
|
|
456
|
-
object: "feature";
|
|
457
|
-
livemode: boolean;
|
|
458
|
-
code: string;
|
|
459
|
-
name: string;
|
|
460
|
-
type: "boolean" | "usage" | "seats";
|
|
461
|
-
allowed: boolean;
|
|
462
|
-
enabled?: boolean;
|
|
463
|
-
current?: number;
|
|
464
|
-
included?: number;
|
|
465
|
-
remaining?: number;
|
|
466
|
-
overage?: number;
|
|
467
|
-
overageUnitPrice?: number;
|
|
468
|
-
unlimited?: boolean;
|
|
469
|
-
overageEnabled?: boolean;
|
|
470
|
-
}
|
|
471
|
-
interface CanUseResult {
|
|
472
|
-
allowed: boolean;
|
|
473
|
-
willBeCharged: boolean;
|
|
474
|
-
reason?: string;
|
|
475
|
-
}
|
|
476
|
-
interface Feature {
|
|
477
|
-
id: string;
|
|
478
|
-
object: "feature";
|
|
479
|
-
livemode: boolean;
|
|
480
|
-
name: string;
|
|
481
|
-
code: string;
|
|
482
|
-
type: "boolean" | "usage" | "seats";
|
|
483
|
-
description: string | null;
|
|
484
|
-
unitName: string | null;
|
|
485
|
-
createdAt: string;
|
|
486
|
-
updatedAt: string;
|
|
487
|
-
}
|
|
488
|
-
interface CreateFeatureParams {
|
|
489
|
-
code: string;
|
|
490
|
-
name: string;
|
|
491
|
-
type: "boolean" | "usage" | "seats";
|
|
492
|
-
description?: string;
|
|
493
|
-
unitName?: string;
|
|
494
|
-
}
|
|
495
|
-
interface UpdateFeatureParams {
|
|
496
|
-
code: string;
|
|
497
|
-
name?: string;
|
|
498
|
-
description?: string;
|
|
499
|
-
unitName?: string;
|
|
500
|
-
}
|
|
501
|
-
interface DeleteFeatureParams {
|
|
502
|
-
code: string;
|
|
503
|
-
}
|
|
504
|
-
declare class FeaturesResource {
|
|
505
|
-
private httpClient;
|
|
506
|
-
constructor(httpClient: CommetHTTPClient);
|
|
507
|
-
get(params: GetFeatureParams, options?: RequestOptions): Promise<ApiResponse<FeatureAccess>>;
|
|
508
|
-
/** Checks if the customer can consume one more unit — returns billing impact and reason if blocked. */
|
|
509
|
-
canUse(params: CanUseFeatureParams, options?: RequestOptions): Promise<ApiResponse<CanUseResult>>;
|
|
510
|
-
list(params: ListFeaturesParams, options?: RequestOptions): Promise<ApiResponse<FeatureAccess[]>>;
|
|
511
|
-
create(params: CreateFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
512
|
-
update(params: UpdateFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
513
|
-
/** Fails if feature is attached to active plans or has an active addon. */
|
|
514
|
-
delete(params: DeleteFeatureParams, options?: RequestOptions): Promise<ApiResponse<{
|
|
515
|
-
id: string;
|
|
516
|
-
deleted: true;
|
|
517
|
-
}>>;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
interface InvoiceLineItem {
|
|
521
|
-
lineType: string;
|
|
522
|
-
featureName: string | null;
|
|
523
|
-
description: string | null;
|
|
524
|
-
quantity: number;
|
|
525
|
-
unitAmount: number;
|
|
526
|
-
amount: number;
|
|
527
|
-
includedAmount: number | null;
|
|
528
|
-
usedAmount: number | null;
|
|
529
|
-
overageAmount: number | null;
|
|
530
|
-
discountType: string | null;
|
|
531
|
-
discountValue: number | null;
|
|
532
|
-
discountName: string | null;
|
|
533
|
-
chargeType: string | null;
|
|
534
|
-
}
|
|
535
|
-
interface InvoiceListItem {
|
|
536
|
-
id: string;
|
|
537
|
-
object: "invoice";
|
|
538
|
-
livemode: boolean;
|
|
539
|
-
customerId: string;
|
|
540
|
-
subscriptionId: string | null;
|
|
541
|
-
invoiceNumber: string;
|
|
542
|
-
status: string;
|
|
543
|
-
invoiceType: string;
|
|
544
|
-
currency: string;
|
|
545
|
-
subtotal: number;
|
|
546
|
-
discountAmount: number;
|
|
547
|
-
taxAmount: number;
|
|
548
|
-
total: number;
|
|
549
|
-
periodStart: string | null;
|
|
550
|
-
periodEnd: string | null;
|
|
551
|
-
issueDate: string;
|
|
552
|
-
dueDate: string | null;
|
|
553
|
-
memo: string | null;
|
|
554
|
-
metadata: Record<string, unknown> | null;
|
|
555
|
-
createdAt: string;
|
|
556
|
-
updatedAt: string;
|
|
557
|
-
}
|
|
558
|
-
interface InvoiceDetail extends InvoiceListItem {
|
|
559
|
-
creditApplied: number;
|
|
560
|
-
planName: string | null;
|
|
561
|
-
poNumber: string | null;
|
|
562
|
-
reference: string | null;
|
|
563
|
-
lineItems: InvoiceLineItem[];
|
|
564
|
-
}
|
|
565
|
-
interface InvoiceDownloadResult {
|
|
566
|
-
url: string;
|
|
567
|
-
expiresAt: string;
|
|
568
|
-
}
|
|
569
|
-
interface InvoiceSendResult {
|
|
570
|
-
sent: boolean;
|
|
571
|
-
sentAt: string;
|
|
572
|
-
}
|
|
573
|
-
interface InvoiceStatusResult {
|
|
574
|
-
id: string;
|
|
575
|
-
status: string;
|
|
576
|
-
updatedAt: string;
|
|
577
|
-
}
|
|
578
|
-
interface CreateAdjustmentResult {
|
|
579
|
-
id: string;
|
|
580
|
-
object: "invoice";
|
|
581
|
-
livemode: boolean;
|
|
582
|
-
customerId: string;
|
|
583
|
-
invoiceNumber: string;
|
|
584
|
-
status: string;
|
|
585
|
-
invoiceType: string;
|
|
586
|
-
currency: string;
|
|
587
|
-
subtotal: number;
|
|
588
|
-
taxAmount: number;
|
|
589
|
-
total: number;
|
|
590
|
-
issueDate: string;
|
|
591
|
-
dueDate: string | null;
|
|
592
|
-
memo: string | null;
|
|
593
|
-
metadata: Record<string, unknown> | null;
|
|
594
|
-
createdAt: string;
|
|
595
|
-
updatedAt: string;
|
|
596
|
-
}
|
|
597
|
-
interface ListInvoicesParams {
|
|
598
|
-
customerId?: string;
|
|
599
|
-
status?: string;
|
|
600
|
-
subscriptionId?: string;
|
|
601
|
-
limit?: number;
|
|
602
|
-
cursor?: string;
|
|
603
|
-
}
|
|
604
|
-
interface GetInvoiceParams {
|
|
605
|
-
id: string;
|
|
606
|
-
}
|
|
607
|
-
interface CreateAdjustmentParams {
|
|
608
|
-
customerId: string;
|
|
609
|
-
amount: number;
|
|
610
|
-
description?: string;
|
|
611
|
-
metadata?: Record<string, unknown>;
|
|
612
|
-
}
|
|
613
|
-
interface GetDownloadUrlParams {
|
|
614
|
-
id: string;
|
|
615
|
-
}
|
|
616
|
-
interface SendInvoiceParams {
|
|
617
|
-
id: string;
|
|
618
|
-
}
|
|
619
|
-
interface UpdateInvoiceStatusParams {
|
|
620
|
-
id: string;
|
|
621
|
-
status: string;
|
|
622
|
-
}
|
|
623
|
-
declare class InvoicesResource {
|
|
624
|
-
private httpClient;
|
|
625
|
-
constructor(httpClient: CommetHTTPClient);
|
|
626
|
-
list(params?: ListInvoicesParams): Promise<ApiResponse<InvoiceListItem[]>>;
|
|
627
|
-
get(params: GetInvoiceParams): Promise<ApiResponse<InvoiceDetail>>;
|
|
628
|
-
/** Negative amount creates a credit. */
|
|
629
|
-
createAdjustment(params: CreateAdjustmentParams, options?: RequestOptions): Promise<ApiResponse<CreateAdjustmentResult>>;
|
|
630
|
-
/** Signed URL, expires after 7 days. */
|
|
631
|
-
getDownloadUrl(params: GetDownloadUrlParams): Promise<ApiResponse<InvoiceDownloadResult>>;
|
|
632
|
-
send(params: SendInvoiceParams, options?: RequestOptions): Promise<ApiResponse<InvoiceSendResult>>;
|
|
633
|
-
/** Only outstanding invoices can be changed to paid or void. */
|
|
634
|
-
updateStatus(params: UpdateInvoiceStatusParams, options?: RequestOptions): Promise<ApiResponse<InvoiceStatusResult>>;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
interface PlanGroup {
|
|
638
|
-
id: string;
|
|
639
|
-
object: "plan_group";
|
|
640
|
-
livemode: boolean;
|
|
641
|
-
name: string;
|
|
642
|
-
description: string | null;
|
|
643
|
-
isPublic: boolean;
|
|
644
|
-
createdAt: string;
|
|
645
|
-
updatedAt: string;
|
|
646
|
-
}
|
|
647
|
-
interface PlanGroupDetail extends PlanGroup {
|
|
648
|
-
plans: Array<{
|
|
649
|
-
id: string;
|
|
650
|
-
code: string;
|
|
651
|
-
name: string;
|
|
652
|
-
sortOrder: number;
|
|
653
|
-
}>;
|
|
654
|
-
}
|
|
655
|
-
interface ListPlanGroupsParams {
|
|
656
|
-
limit?: number;
|
|
657
|
-
cursor?: string;
|
|
658
|
-
}
|
|
659
|
-
interface GetPlanGroupParams {
|
|
660
|
-
id: string;
|
|
661
|
-
}
|
|
662
|
-
interface CreatePlanGroupParams {
|
|
663
|
-
name: string;
|
|
664
|
-
description?: string;
|
|
665
|
-
isPublic?: boolean;
|
|
666
|
-
}
|
|
667
|
-
interface UpdatePlanGroupParams {
|
|
668
|
-
id: string;
|
|
669
|
-
name?: string;
|
|
670
|
-
description?: string;
|
|
671
|
-
isPublic?: boolean;
|
|
672
|
-
}
|
|
673
|
-
interface DeletePlanGroupParams {
|
|
674
|
-
id: string;
|
|
675
|
-
}
|
|
676
|
-
interface AddPlanToGroupParams {
|
|
677
|
-
id: string;
|
|
678
|
-
planId: string;
|
|
679
|
-
sortOrder?: number;
|
|
680
|
-
}
|
|
681
|
-
interface RemovePlanFromGroupParams {
|
|
682
|
-
id: string;
|
|
683
|
-
planId: string;
|
|
684
|
-
}
|
|
685
|
-
interface ReorderPlansParams {
|
|
686
|
-
id: string;
|
|
687
|
-
planIds: string[];
|
|
688
|
-
}
|
|
689
|
-
declare class PlanGroupsResource {
|
|
690
|
-
private httpClient;
|
|
691
|
-
constructor(httpClient: CommetHTTPClient);
|
|
692
|
-
list(params?: ListPlanGroupsParams): Promise<ApiResponse<PlanGroup[]>>;
|
|
693
|
-
get(params: GetPlanGroupParams): Promise<ApiResponse<PlanGroupDetail>>;
|
|
694
|
-
create(params: CreatePlanGroupParams, options?: RequestOptions): Promise<ApiResponse<PlanGroup>>;
|
|
695
|
-
update(params: UpdatePlanGroupParams, options?: RequestOptions): Promise<ApiResponse<PlanGroup>>;
|
|
696
|
-
/** Plans in the group are unlinked, not deleted. */
|
|
697
|
-
delete(params: DeletePlanGroupParams, options?: RequestOptions): Promise<ApiResponse<void>>;
|
|
698
|
-
addPlan(params: AddPlanToGroupParams, options?: RequestOptions): Promise<ApiResponse<PlanGroupDetail>>;
|
|
699
|
-
removePlan(params: RemovePlanFromGroupParams, options?: RequestOptions): Promise<ApiResponse<void>>;
|
|
700
|
-
reorderPlans(params: ReorderPlansParams, options?: RequestOptions): Promise<ApiResponse<PlanGroupDetail>>;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
444
|
type PlanID = `plan_${string}`;
|
|
704
445
|
type BillingInterval = "weekly" | "monthly" | "quarterly" | "yearly" | "one_time";
|
|
705
|
-
type FeatureType = "boolean" | "usage" | "seats";
|
|
446
|
+
type FeatureType = "boolean" | "usage" | "seats" | "quota";
|
|
706
447
|
interface PlanPrice {
|
|
707
448
|
billingInterval: BillingInterval;
|
|
708
449
|
price: number;
|
|
@@ -976,6 +717,266 @@ declare class PlansResource {
|
|
|
976
717
|
deleteRegionalPrices(params: DeleteRegionalPricesParams, options?: RequestOptions): Promise<ApiResponse<DeleteResult>>;
|
|
977
718
|
}
|
|
978
719
|
|
|
720
|
+
interface GetFeatureParams {
|
|
721
|
+
customerId: CustomerID;
|
|
722
|
+
code: string;
|
|
723
|
+
}
|
|
724
|
+
interface CanUseFeatureParams {
|
|
725
|
+
customerId: CustomerID;
|
|
726
|
+
code: string;
|
|
727
|
+
}
|
|
728
|
+
interface ListFeaturesParams {
|
|
729
|
+
customerId: CustomerID;
|
|
730
|
+
}
|
|
731
|
+
interface FeatureAccess {
|
|
732
|
+
object: "feature";
|
|
733
|
+
livemode: boolean;
|
|
734
|
+
code: string;
|
|
735
|
+
name: string;
|
|
736
|
+
type: FeatureType;
|
|
737
|
+
allowed: boolean;
|
|
738
|
+
enabled?: boolean;
|
|
739
|
+
current?: number;
|
|
740
|
+
included?: number;
|
|
741
|
+
remaining?: number;
|
|
742
|
+
overage?: number;
|
|
743
|
+
overageUnitPrice?: number;
|
|
744
|
+
billedQuantity?: number;
|
|
745
|
+
unlimited?: boolean;
|
|
746
|
+
overageEnabled?: boolean;
|
|
747
|
+
}
|
|
748
|
+
interface CanUseResult {
|
|
749
|
+
allowed: boolean;
|
|
750
|
+
willBeCharged: boolean;
|
|
751
|
+
reason?: string;
|
|
752
|
+
}
|
|
753
|
+
interface Feature {
|
|
754
|
+
id: string;
|
|
755
|
+
object: "feature";
|
|
756
|
+
livemode: boolean;
|
|
757
|
+
name: string;
|
|
758
|
+
code: string;
|
|
759
|
+
type: FeatureType;
|
|
760
|
+
description: string | null;
|
|
761
|
+
unitName: string | null;
|
|
762
|
+
createdAt: string;
|
|
763
|
+
updatedAt: string;
|
|
764
|
+
}
|
|
765
|
+
interface CreateFeatureParams {
|
|
766
|
+
code: string;
|
|
767
|
+
name: string;
|
|
768
|
+
type: FeatureType;
|
|
769
|
+
description?: string;
|
|
770
|
+
unitName?: string;
|
|
771
|
+
}
|
|
772
|
+
interface UpdateFeatureParams {
|
|
773
|
+
code: string;
|
|
774
|
+
name?: string;
|
|
775
|
+
description?: string;
|
|
776
|
+
unitName?: string;
|
|
777
|
+
}
|
|
778
|
+
interface DeleteFeatureParams {
|
|
779
|
+
code: string;
|
|
780
|
+
}
|
|
781
|
+
declare class FeaturesResource {
|
|
782
|
+
private httpClient;
|
|
783
|
+
constructor(httpClient: CommetHTTPClient);
|
|
784
|
+
get(params: GetFeatureParams, options?: RequestOptions): Promise<ApiResponse<FeatureAccess>>;
|
|
785
|
+
/** Checks if the customer can consume one more unit — returns billing impact and reason if blocked. */
|
|
786
|
+
canUse(params: CanUseFeatureParams, options?: RequestOptions): Promise<ApiResponse<CanUseResult>>;
|
|
787
|
+
list(params: ListFeaturesParams, options?: RequestOptions): Promise<ApiResponse<FeatureAccess[]>>;
|
|
788
|
+
create(params: CreateFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
789
|
+
update(params: UpdateFeatureParams, options?: RequestOptions): Promise<ApiResponse<Feature>>;
|
|
790
|
+
/** Fails if feature is attached to active plans or has an active addon. */
|
|
791
|
+
delete(params: DeleteFeatureParams, options?: RequestOptions): Promise<ApiResponse<{
|
|
792
|
+
id: string;
|
|
793
|
+
deleted: true;
|
|
794
|
+
}>>;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
interface InvoiceLineItem {
|
|
798
|
+
lineType: string;
|
|
799
|
+
featureName: string | null;
|
|
800
|
+
description: string | null;
|
|
801
|
+
quantity: number;
|
|
802
|
+
unitAmount: number;
|
|
803
|
+
amount: number;
|
|
804
|
+
includedAmount: number | null;
|
|
805
|
+
usedAmount: number | null;
|
|
806
|
+
overageAmount: number | null;
|
|
807
|
+
discountType: string | null;
|
|
808
|
+
discountValue: number | null;
|
|
809
|
+
discountName: string | null;
|
|
810
|
+
chargeType: string | null;
|
|
811
|
+
}
|
|
812
|
+
interface InvoiceListItem {
|
|
813
|
+
id: string;
|
|
814
|
+
object: "invoice";
|
|
815
|
+
livemode: boolean;
|
|
816
|
+
customerId: string;
|
|
817
|
+
subscriptionId: string | null;
|
|
818
|
+
invoiceNumber: string;
|
|
819
|
+
status: string;
|
|
820
|
+
invoiceType: string;
|
|
821
|
+
currency: string;
|
|
822
|
+
subtotal: number;
|
|
823
|
+
discountAmount: number;
|
|
824
|
+
taxAmount: number;
|
|
825
|
+
total: number;
|
|
826
|
+
periodStart: string | null;
|
|
827
|
+
periodEnd: string | null;
|
|
828
|
+
issueDate: string;
|
|
829
|
+
dueDate: string | null;
|
|
830
|
+
memo: string | null;
|
|
831
|
+
metadata: Record<string, unknown> | null;
|
|
832
|
+
createdAt: string;
|
|
833
|
+
updatedAt: string;
|
|
834
|
+
}
|
|
835
|
+
interface InvoiceDetail extends InvoiceListItem {
|
|
836
|
+
creditApplied: number;
|
|
837
|
+
planName: string | null;
|
|
838
|
+
poNumber: string | null;
|
|
839
|
+
reference: string | null;
|
|
840
|
+
lineItems: InvoiceLineItem[];
|
|
841
|
+
}
|
|
842
|
+
interface InvoiceDownloadResult {
|
|
843
|
+
url: string;
|
|
844
|
+
expiresAt: string;
|
|
845
|
+
}
|
|
846
|
+
interface InvoiceSendResult {
|
|
847
|
+
sent: boolean;
|
|
848
|
+
sentAt: string;
|
|
849
|
+
}
|
|
850
|
+
interface InvoiceStatusResult {
|
|
851
|
+
id: string;
|
|
852
|
+
status: string;
|
|
853
|
+
updatedAt: string;
|
|
854
|
+
}
|
|
855
|
+
interface CreateAdjustmentResult {
|
|
856
|
+
id: string;
|
|
857
|
+
object: "invoice";
|
|
858
|
+
livemode: boolean;
|
|
859
|
+
customerId: string;
|
|
860
|
+
invoiceNumber: string;
|
|
861
|
+
status: string;
|
|
862
|
+
invoiceType: string;
|
|
863
|
+
currency: string;
|
|
864
|
+
subtotal: number;
|
|
865
|
+
taxAmount: number;
|
|
866
|
+
total: number;
|
|
867
|
+
issueDate: string;
|
|
868
|
+
dueDate: string | null;
|
|
869
|
+
memo: string | null;
|
|
870
|
+
metadata: Record<string, unknown> | null;
|
|
871
|
+
createdAt: string;
|
|
872
|
+
updatedAt: string;
|
|
873
|
+
}
|
|
874
|
+
interface ListInvoicesParams {
|
|
875
|
+
customerId?: string;
|
|
876
|
+
status?: string;
|
|
877
|
+
subscriptionId?: string;
|
|
878
|
+
limit?: number;
|
|
879
|
+
cursor?: string;
|
|
880
|
+
}
|
|
881
|
+
interface GetInvoiceParams {
|
|
882
|
+
id: string;
|
|
883
|
+
}
|
|
884
|
+
interface CreateAdjustmentParams {
|
|
885
|
+
customerId: string;
|
|
886
|
+
amount: number;
|
|
887
|
+
description?: string;
|
|
888
|
+
metadata?: Record<string, unknown>;
|
|
889
|
+
}
|
|
890
|
+
interface GetDownloadUrlParams {
|
|
891
|
+
id: string;
|
|
892
|
+
}
|
|
893
|
+
interface SendInvoiceParams {
|
|
894
|
+
id: string;
|
|
895
|
+
}
|
|
896
|
+
interface UpdateInvoiceStatusParams {
|
|
897
|
+
id: string;
|
|
898
|
+
status: string;
|
|
899
|
+
}
|
|
900
|
+
declare class InvoicesResource {
|
|
901
|
+
private httpClient;
|
|
902
|
+
constructor(httpClient: CommetHTTPClient);
|
|
903
|
+
list(params?: ListInvoicesParams): Promise<ApiResponse<InvoiceListItem[]>>;
|
|
904
|
+
get(params: GetInvoiceParams): Promise<ApiResponse<InvoiceDetail>>;
|
|
905
|
+
/** Negative amount creates a credit. */
|
|
906
|
+
createAdjustment(params: CreateAdjustmentParams, options?: RequestOptions): Promise<ApiResponse<CreateAdjustmentResult>>;
|
|
907
|
+
/** Signed URL, expires after 7 days. */
|
|
908
|
+
getDownloadUrl(params: GetDownloadUrlParams): Promise<ApiResponse<InvoiceDownloadResult>>;
|
|
909
|
+
send(params: SendInvoiceParams, options?: RequestOptions): Promise<ApiResponse<InvoiceSendResult>>;
|
|
910
|
+
/** Only outstanding invoices can be changed to paid or void. */
|
|
911
|
+
updateStatus(params: UpdateInvoiceStatusParams, options?: RequestOptions): Promise<ApiResponse<InvoiceStatusResult>>;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
interface PlanGroup {
|
|
915
|
+
id: string;
|
|
916
|
+
object: "plan_group";
|
|
917
|
+
livemode: boolean;
|
|
918
|
+
name: string;
|
|
919
|
+
description: string | null;
|
|
920
|
+
isPublic: boolean;
|
|
921
|
+
createdAt: string;
|
|
922
|
+
updatedAt: string;
|
|
923
|
+
}
|
|
924
|
+
interface PlanGroupDetail extends PlanGroup {
|
|
925
|
+
plans: Array<{
|
|
926
|
+
id: string;
|
|
927
|
+
code: string;
|
|
928
|
+
name: string;
|
|
929
|
+
sortOrder: number;
|
|
930
|
+
}>;
|
|
931
|
+
}
|
|
932
|
+
interface ListPlanGroupsParams {
|
|
933
|
+
limit?: number;
|
|
934
|
+
cursor?: string;
|
|
935
|
+
}
|
|
936
|
+
interface GetPlanGroupParams {
|
|
937
|
+
id: string;
|
|
938
|
+
}
|
|
939
|
+
interface CreatePlanGroupParams {
|
|
940
|
+
name: string;
|
|
941
|
+
description?: string;
|
|
942
|
+
isPublic?: boolean;
|
|
943
|
+
}
|
|
944
|
+
interface UpdatePlanGroupParams {
|
|
945
|
+
id: string;
|
|
946
|
+
name?: string;
|
|
947
|
+
description?: string;
|
|
948
|
+
isPublic?: boolean;
|
|
949
|
+
}
|
|
950
|
+
interface DeletePlanGroupParams {
|
|
951
|
+
id: string;
|
|
952
|
+
}
|
|
953
|
+
interface AddPlanToGroupParams {
|
|
954
|
+
id: string;
|
|
955
|
+
planId: string;
|
|
956
|
+
sortOrder?: number;
|
|
957
|
+
}
|
|
958
|
+
interface RemovePlanFromGroupParams {
|
|
959
|
+
id: string;
|
|
960
|
+
planId: string;
|
|
961
|
+
}
|
|
962
|
+
interface ReorderPlansParams {
|
|
963
|
+
id: string;
|
|
964
|
+
planIds: string[];
|
|
965
|
+
}
|
|
966
|
+
declare class PlanGroupsResource {
|
|
967
|
+
private httpClient;
|
|
968
|
+
constructor(httpClient: CommetHTTPClient);
|
|
969
|
+
list(params?: ListPlanGroupsParams): Promise<ApiResponse<PlanGroup[]>>;
|
|
970
|
+
get(params: GetPlanGroupParams): Promise<ApiResponse<PlanGroupDetail>>;
|
|
971
|
+
create(params: CreatePlanGroupParams, options?: RequestOptions): Promise<ApiResponse<PlanGroup>>;
|
|
972
|
+
update(params: UpdatePlanGroupParams, options?: RequestOptions): Promise<ApiResponse<PlanGroup>>;
|
|
973
|
+
/** Plans in the group are unlinked, not deleted. */
|
|
974
|
+
delete(params: DeletePlanGroupParams, options?: RequestOptions): Promise<ApiResponse<void>>;
|
|
975
|
+
addPlan(params: AddPlanToGroupParams, options?: RequestOptions): Promise<ApiResponse<PlanGroupDetail>>;
|
|
976
|
+
removePlan(params: RemovePlanFromGroupParams, options?: RequestOptions): Promise<ApiResponse<void>>;
|
|
977
|
+
reorderPlans(params: ReorderPlansParams, options?: RequestOptions): Promise<ApiResponse<PlanGroupDetail>>;
|
|
978
|
+
}
|
|
979
|
+
|
|
979
980
|
interface PortalAccess {
|
|
980
981
|
success: boolean;
|
|
981
982
|
message: string;
|
|
@@ -1045,6 +1046,57 @@ declare class PromoCodesResource {
|
|
|
1045
1046
|
update(params: UpdatePromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCodeDetail>>;
|
|
1046
1047
|
}
|
|
1047
1048
|
|
|
1049
|
+
interface QuotaEvent {
|
|
1050
|
+
id: string;
|
|
1051
|
+
customerId: CustomerID;
|
|
1052
|
+
featureCode: string;
|
|
1053
|
+
previousBalance: number;
|
|
1054
|
+
newBalance: number;
|
|
1055
|
+
ts: string;
|
|
1056
|
+
createdAt: string;
|
|
1057
|
+
}
|
|
1058
|
+
interface QuotaAllowance {
|
|
1059
|
+
featureCode: string;
|
|
1060
|
+
current: number;
|
|
1061
|
+
included: number;
|
|
1062
|
+
remaining: number | null;
|
|
1063
|
+
billedQuantity?: number;
|
|
1064
|
+
unlimited: boolean;
|
|
1065
|
+
overageEnabled: boolean;
|
|
1066
|
+
asOf: string | null;
|
|
1067
|
+
}
|
|
1068
|
+
interface AddQuotaParams {
|
|
1069
|
+
customerId: CustomerID;
|
|
1070
|
+
featureCode: string;
|
|
1071
|
+
count?: number;
|
|
1072
|
+
}
|
|
1073
|
+
interface SetQuotaParams {
|
|
1074
|
+
customerId: CustomerID;
|
|
1075
|
+
featureCode: string;
|
|
1076
|
+
count: number;
|
|
1077
|
+
}
|
|
1078
|
+
interface RemoveQuotaParams {
|
|
1079
|
+
customerId: CustomerID;
|
|
1080
|
+
featureCode: string;
|
|
1081
|
+
count?: number;
|
|
1082
|
+
}
|
|
1083
|
+
interface GetQuotaParams {
|
|
1084
|
+
customerId: CustomerID;
|
|
1085
|
+
featureCode: string;
|
|
1086
|
+
}
|
|
1087
|
+
interface GetAllQuotaParams {
|
|
1088
|
+
customerId: CustomerID;
|
|
1089
|
+
}
|
|
1090
|
+
declare class QuotaResource {
|
|
1091
|
+
private httpClient;
|
|
1092
|
+
constructor(httpClient: CommetHTTPClient);
|
|
1093
|
+
add(params: AddQuotaParams, options?: RequestOptions): Promise<ApiResponse<QuotaEvent>>;
|
|
1094
|
+
set(params: SetQuotaParams, options?: RequestOptions): Promise<ApiResponse<QuotaEvent>>;
|
|
1095
|
+
remove(params: RemoveQuotaParams, options?: RequestOptions): Promise<ApiResponse<QuotaEvent>>;
|
|
1096
|
+
get(params: GetQuotaParams): Promise<ApiResponse<QuotaAllowance>>;
|
|
1097
|
+
getAll(params: GetAllQuotaParams): Promise<ApiResponse<QuotaAllowance[]>>;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1048
1100
|
interface SeatEvent {
|
|
1049
1101
|
id: string;
|
|
1050
1102
|
object: "seat";
|
|
@@ -1106,7 +1158,7 @@ type SubscriptionStatus = "draft" | "pending_payment" | "trialing" | "active" |
|
|
|
1106
1158
|
interface FeatureSummary {
|
|
1107
1159
|
code: string;
|
|
1108
1160
|
name: string;
|
|
1109
|
-
type:
|
|
1161
|
+
type: FeatureType;
|
|
1110
1162
|
enabled?: boolean;
|
|
1111
1163
|
usage?: {
|
|
1112
1164
|
current: number;
|
|
@@ -1635,6 +1687,7 @@ declare class Commet<_TConfig = unknown> {
|
|
|
1635
1687
|
readonly plans: PlansResource;
|
|
1636
1688
|
readonly portal: PortalResource;
|
|
1637
1689
|
readonly promoCodes: PromoCodesResource;
|
|
1690
|
+
readonly quota: QuotaResource;
|
|
1638
1691
|
readonly seats: SeatsResource;
|
|
1639
1692
|
readonly subscriptions: SubscriptionsResource;
|
|
1640
1693
|
readonly transactions: TransactionsResource;
|
|
@@ -1649,4 +1702,4 @@ declare function registerIntegration(name: string, version: string): void;
|
|
|
1649
1702
|
declare const API_VERSION = "2026-05-25";
|
|
1650
1703
|
declare const SDK_VERSION: string;
|
|
1651
1704
|
|
|
1652
|
-
export { API_VERSION, type ActivateAddonParams, type ActivateAddonResult, type ActiveAddon, type ActiveSubscription, type AddAiModelPricingFeatureParams, type AddFixedPricingFeatureParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddSeatsParams, type Addon, type AdjustBalanceParams, type AdjustBalanceResult, type AiModelPricingFeatureManage, type ApiErrorDetail, type ApiKey, type ApiKeyCreated, type ApiResponse, type BalanceAddon, type BillingConfig, type BillingInterval, type BooleanAddon, type CanUseFeatureParams, type CanUseResult, type CancelParams, type CancellationSummary, type ChangePlanParams, type ChangePlanResult, type CheckUsageParams, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CreateAddonParams, type CreateAdjustmentParams, type CreateAdjustmentResult, type CreateApiKeyParams, type CreateBalanceAddonParams, type CreateBooleanAddonParams, type CreateCreditPackParams, type CreateCreditsAddonParams, type CreateParams as CreateCustomerParams, type CreateFeatureParams, type CreateMeteredAddonParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateWebhookParams, type CreatedSubscription, type CreditPack, type CreditPackDetail, type CreditsAddon, type Currency, type Customer, type CustomerAddress, type CustomerID, type BatchResult as CustomersBatchResult, type DeactivateAddonParams, type DeactivateAddonResult, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteResult, type DeleteWebhookParams, type DiscountSummary, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureSummary, type FeatureType, type FixedPricingFeatureManage, type GetActiveParams, type GetAddonParams, type GetAllBalancesParams, type GetBalanceParams, type GetCustomerParams, type GetDownloadUrlParams, type GetFeatureParams, type GetInvoiceParams, type GetPlanGroupParams, type GetPromoCodeParams, type GetTransactionParams, type GetUrlParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type InvoiceDetail, type InvoiceDownloadResult, type InvoiceLineItem, type InvoiceListItem, type InvoiceSendResult, type InvoiceStatusResult, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeaturesParams, type ListInvoicesParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type MeteredAddon, type PaginatedList, type PaginatedResponse, type Plan, type PlanDef, type PlanDetail, type PlanFeature, type PlanFeatureManage, type PlanFeatureValue, type PlanGroup, type PlanGroupDetail, type PlanID, type PlanManage, type PlanPrice, type PlanPriceManage, type PortalAccess, type PreviewChangeParams, type PreviewChangeResult, type PriceDef, type PromoCode, type PromoCodeDetail, type PurchaseCreditsParams, type PurchaseCreditsResult, type RefundTransactionParams, type RegionalPriceResult, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveResult, type RemoveSeatsParams, type ReorderPlansParams, type RequestOptions, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatEvent, type SendInvoiceParams, type SetAllSeatsParams, type SetDefaultPriceParams, type SetRegionalPricesParams, type SetSeatsParams, type SetVisibilityParams, type Subscription, type SubscriptionListItem, type SubscriptionStatus, type TestWebhookParams, type TopupBalanceParams, type TopupBalanceResult, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type TransactionDetail, type TransactionListItem, type TransactionRefundResult, type TransactionRetryResult, type UncancelParams, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateParams as UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookPayload, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
|
1705
|
+
export { API_VERSION, type ActivateAddonParams, type ActivateAddonResult, type ActiveAddon, type ActiveSubscription, type AddAiModelPricingFeatureParams, type AddFixedPricingFeatureParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type Addon, type AdjustBalanceParams, type AdjustBalanceResult, type AiModelPricingFeatureManage, type ApiErrorDetail, type ApiKey, type ApiKeyCreated, type ApiResponse, type BalanceAddon, type BillingConfig, type BillingInterval, type BooleanAddon, type CanUseFeatureParams, type CanUseResult, type CancelParams, type CancellationSummary, type ChangePlanParams, type ChangePlanResult, type CheckUsageParams, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CreateAddonParams, type CreateAdjustmentParams, type CreateAdjustmentResult, type CreateApiKeyParams, type CreateBalanceAddonParams, type CreateBooleanAddonParams, type CreateCreditPackParams, type CreateCreditsAddonParams, type CreateParams as CreateCustomerParams, type CreateFeatureParams, type CreateMeteredAddonParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateWebhookParams, type CreatedSubscription, type CreditPack, type CreditPackDetail, type CreditsAddon, type Currency, type Customer, type CustomerAddress, type CustomerID, type BatchResult as CustomersBatchResult, type DeactivateAddonParams, type DeactivateAddonResult, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteResult, type DeleteWebhookParams, type DiscountSummary, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureSummary, type FeatureType, type FixedPricingFeatureManage, type GetActiveParams, type GetAddonParams, type GetAllBalancesParams, type GetAllQuotaParams, type GetBalanceParams, type GetCustomerParams, type GetDownloadUrlParams, type GetFeatureParams, type GetInvoiceParams, type GetPlanGroupParams, type GetPromoCodeParams, type GetQuotaParams, type GetTransactionParams, type GetUrlParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type InvoiceDetail, type InvoiceDownloadResult, type InvoiceLineItem, type InvoiceListItem, type InvoiceSendResult, type InvoiceStatusResult, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeaturesParams, type ListInvoicesParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type MeteredAddon, type PaginatedList, type PaginatedResponse, type Plan, type PlanDef, type PlanDetail, type PlanFeature, type PlanFeatureManage, type PlanFeatureValue, type PlanGroup, type PlanGroupDetail, type PlanID, type PlanManage, type PlanPrice, type PlanPriceManage, type PortalAccess, type PreviewChangeParams, type PreviewChangeResult, type PriceDef, type PromoCode, type PromoCodeDetail, type PurchaseCreditsParams, type PurchaseCreditsResult, type QuotaAllowance, type QuotaEvent, type RefundTransactionParams, type RegionalPriceResult, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveResult, type RemoveSeatsParams, type ReorderPlansParams, type RequestOptions, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatEvent, type SendInvoiceParams, type SetAllSeatsParams, type SetDefaultPriceParams, type SetQuotaParams, type SetRegionalPricesParams, type SetSeatsParams, type SetVisibilityParams, type Subscription, type SubscriptionListItem, type SubscriptionStatus, type TestWebhookParams, type TopupBalanceParams, type TopupBalanceResult, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type TransactionDetail, type TransactionListItem, type TransactionRefundResult, type TransactionRetryResult, type UncancelParams, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateParams as UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookPayload, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|