@commet/node 9.8.0 → 9.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 +1021 -30
- package/dist/index.d.ts +1021 -30
- package/dist/index.js +204 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -11
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/mcp-server.md +2 -0
- package/docs/api-reference/addons.md +3 -1
- package/docs/api-reference/credit-packs.md +3 -1
- package/docs/api-reference/customers.md +2 -0
- package/docs/api-reference/generated-webhooks.md +2 -2
- package/docs/api-reference/index.md +3 -3
- package/docs/api-reference/plans.md +488 -6
- package/docs/api-reference/subscriptions.md +50 -8
- package/docs/documentation/api-versioning.md +8 -2
- package/docs/documentation/cli.md +64 -49
- package/docs/documentation/create-api-key.md +3 -1
- package/docs/documentation/customers/customer-portal.md +10 -2
- package/docs/documentation/customers/manage-customers.md +2 -1
- package/docs/documentation/finance/payouts.md +11 -0
- package/docs/documentation/finance/supported-countries.md +5 -5
- package/docs/documentation/invoicing/handle-failed-payments.md +9 -9
- package/docs/documentation/payments/accept-one-time-payments.md +1 -1
- package/docs/documentation/payments/payment-orchestration.md +2 -0
- package/docs/documentation/payments/payment-providers.md +46 -0
- package/docs/documentation/payments/transactions-refunds-and-retries.md +1 -1
- package/docs/documentation/plans/add-ons.md +15 -4
- package/docs/documentation/plans/consumption-models.md +44 -9
- package/docs/documentation/plans/create-plans.md +5 -1
- package/docs/documentation/plans/credit-packs.md +61 -3
- package/docs/documentation/plans/one-time-payments.md +3 -3
- package/docs/documentation/plans/plan-groups.md +46 -10
- package/docs/documentation/plans/plan-versions.md +265 -0
- package/docs/documentation/platform/dashboard-metrics-and-events.md +40 -9
- package/docs/documentation/sales/connect-dub-affiliates.md +52 -0
- package/docs/documentation/sales/introductory-offers.md +7 -13
- package/docs/documentation/sales/offers.md +10 -6
- package/docs/documentation/sales/promo-codes.md +47 -17
- package/docs/documentation/sales/promotional-offers.md +6 -7
- package/docs/documentation/sales/regional-prices.md +38 -8
- package/docs/documentation/sales/trial-periods.md +67 -40
- package/docs/documentation/subscriptions/manage-subscriptions.md +114 -14
- package/docs/documentation/subscriptions/pay-in-advance.md +4 -7
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +22 -2
- package/docs/documentation/testing-sandbox.md +2 -0
- package/docs/documentation/usage/track-usage.md +23 -0
- package/docs/errors/addon_has_activations.md +2 -2
- package/docs/errors/addon_unavailable.md +22 -0
- package/docs/errors/credit_pack_unavailable.md +22 -0
- package/docs/errors/index.md +9 -2
- package/docs/errors/missing_regional_price.md +3 -3
- package/docs/errors/plan_balance_limit_reached.md +22 -0
- package/docs/errors/plan_experiment_not_found.md +22 -0
- package/docs/errors/plan_version_not_found.md +22 -0
- package/docs/errors/subscribers_do_not_fit.md +22 -0
- package/docs/errors/version_not_newer.md +22 -0
- package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +8 -8
- package/docs/knowledge-base/how-do-discounts-work.md +7 -5
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +18 -11
- package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +1 -1
- package/docs/knowledge-base/how-do-trial-periods-work.md +31 -25
- package/docs/knowledge-base/how-does-billing-work.md +26 -27
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +12 -22
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +12 -22
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +11 -8
- package/docs/knowledge-base/what-happens-when-a-payment-fails.md +11 -9
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +34 -29
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -1
- package/docs/manifest.json +201 -2
- package/docs/platform-documentation.md +2 -0
- package/docs/schemas.md +134 -14
- package/docs/webhooks/introduction.md +17 -13
- package/docs/webhooks.md +66 -6
- package/docs/webhooks.openapi.json +1218 -876
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ var AddonsResource = class {
|
|
|
12
12
|
const { id } = params;
|
|
13
13
|
return this.httpClient.get(`/addons/${id}`, void 0, options);
|
|
14
14
|
}
|
|
15
|
-
/** Update an add-on's name, description, or
|
|
15
|
+
/** Update an add-on's name, description, pricing, or the plans that sell it. */
|
|
16
16
|
async update(params, options) {
|
|
17
17
|
const { id, ...rest } = params;
|
|
18
18
|
return this.httpClient.patch(`/addons/${id}`, rest, options);
|
|
@@ -57,7 +57,7 @@ var CreditPacksResource = class {
|
|
|
57
57
|
constructor(httpClient) {
|
|
58
58
|
this.httpClient = httpClient;
|
|
59
59
|
}
|
|
60
|
-
/** Update a credit pack's name, description, credits, price, or
|
|
60
|
+
/** Update a credit pack's name, description, credits, price, active status, or the plans that sell it. */
|
|
61
61
|
async update(params, options) {
|
|
62
62
|
const { id, ...rest } = params;
|
|
63
63
|
return this.httpClient.patch(`/credit-packs/${id}`, rest, options);
|
|
@@ -407,6 +407,98 @@ var PlansResource = class {
|
|
|
407
407
|
constructor(httpClient) {
|
|
408
408
|
this.httpClient = httpClient;
|
|
409
409
|
}
|
|
410
|
+
/** Publish a draft as the plan's current version, as a new experiment with its own code, or as the next version of the experiment it started from. A country missing a price, or removing the signup trial of the plan's group from the current version, stops the publication. With move, subscribers of earlier versions move at their renewal or now; if any of them does not fit the new version, nothing is published and the response lists each one with what would make it fit, to send back in changes. Paused subscribers stay where they are. Send preview to check without publishing. */
|
|
411
|
+
async publishDraft(params, options) {
|
|
412
|
+
const { id, draftId, ...rest } = params;
|
|
413
|
+
return this.httpClient.post(
|
|
414
|
+
`/plans/${id}/drafts/${draftId}/publish`,
|
|
415
|
+
rest,
|
|
416
|
+
options
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
/** Retrieve a draft with the version it started from and what it changes. */
|
|
420
|
+
async getDraft(params, options) {
|
|
421
|
+
const { id, draftId } = params;
|
|
422
|
+
return this.httpClient.get(
|
|
423
|
+
`/plans/${id}/drafts/${draftId}`,
|
|
424
|
+
void 0,
|
|
425
|
+
options
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
/** Change a draft's prices per interval, trials, the interval shown first, countries with their currency and prices, and credit or balance rules, or undo single changes. Each block sent replaces that block; blocks left out stay as they are. Buyers and subscribers see nothing until the draft is published. */
|
|
429
|
+
async updateDraft(params, options) {
|
|
430
|
+
const { id, draftId, ...rest } = params;
|
|
431
|
+
return this.httpClient.patch(
|
|
432
|
+
`/plans/${id}/drafts/${draftId}`,
|
|
433
|
+
rest,
|
|
434
|
+
options
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
/** Discard a draft. Nothing it changed was ever sold. */
|
|
438
|
+
async deleteDraft(params, options) {
|
|
439
|
+
const { id, draftId } = params;
|
|
440
|
+
return this.httpClient.delete(
|
|
441
|
+
`/plans/${id}/drafts/${draftId}`,
|
|
442
|
+
void 0,
|
|
443
|
+
options
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
/** List the plan's open drafts, oldest first, each with the version it started from and what it changes. Drafts sell nothing until published. */
|
|
447
|
+
async listDrafts(params, options) {
|
|
448
|
+
const { id } = params;
|
|
449
|
+
return this.httpClient.get(`/plans/${id}/drafts`, void 0, options);
|
|
450
|
+
}
|
|
451
|
+
/** Start a draft from a version of the plan: the current one, an experiment's version or an older one. A plan can have any number of drafts. Edit it, then publish it as the current version, as an experiment or as an experiment's next version; nothing changes for buyers or subscribers until then. */
|
|
452
|
+
async createDraft(params, options) {
|
|
453
|
+
const { id, ...rest } = params;
|
|
454
|
+
return this.httpClient.post(`/plans/${id}/drafts`, rest, options);
|
|
455
|
+
}
|
|
456
|
+
/** Stop selling the experiment. Its code sells the plan's current version from then on, so links already shared keep working. Choose what happens to its subscribers: keep them on its versions, or move them to the current version at their renewal or now. If any of them does not fit, nothing changes and the response lists each one with what would make it fit, to send back in changes. */
|
|
457
|
+
async archiveExperiment(params, options) {
|
|
458
|
+
const { id, code, ...rest } = params;
|
|
459
|
+
return this.httpClient.post(
|
|
460
|
+
`/plans/${id}/experiments/${code}/archive`,
|
|
461
|
+
rest,
|
|
462
|
+
options
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
/** Make the experiment's latest version the plan's current version, with exactly its content and the next version number. New buyers get it; its subscribers are already on it. The experiment closes, and its code sells the plan's current version from then on. Nobody else moves. */
|
|
466
|
+
async makeExperimentCurrent(params, options) {
|
|
467
|
+
const { id, code } = params;
|
|
468
|
+
return this.httpClient.post(
|
|
469
|
+
`/plans/${id}/experiments/${code}/make-current`,
|
|
470
|
+
{},
|
|
471
|
+
options
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
/** Get one experiment of a plan by its own code, with the version it sells and how many subscriptions are on it. */
|
|
475
|
+
async getExperiment(params, options) {
|
|
476
|
+
const { id, code } = params;
|
|
477
|
+
return this.httpClient.get(
|
|
478
|
+
`/plans/${id}/experiments/${code}`,
|
|
479
|
+
void 0,
|
|
480
|
+
options
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
/** Publish the experiment's next version from its latest version with the changes given. Its code sells the new version from now on; subscribers on its earlier versions stay where they are until moved. */
|
|
484
|
+
async createExperimentVersion(params, options) {
|
|
485
|
+
const { id, code, ...rest } = params;
|
|
486
|
+
return this.httpClient.post(
|
|
487
|
+
`/plans/${id}/experiments/${code}/versions`,
|
|
488
|
+
rest,
|
|
489
|
+
options
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
/** List a plan's experiments, newest first, with the version each one sells and how many subscriptions are on them. */
|
|
493
|
+
async listExperiments(params, options) {
|
|
494
|
+
const { id } = params;
|
|
495
|
+
return this.httpClient.get(`/plans/${id}/experiments`, void 0, options);
|
|
496
|
+
}
|
|
497
|
+
/** Start an experiment from the plan's current version with the changes given. It is sold only through its code (planCode `<plan code>:<code>`); new buyers of the plan keep getting the current version. */
|
|
498
|
+
async createExperiment(params, options) {
|
|
499
|
+
const { id, ...rest } = params;
|
|
500
|
+
return this.httpClient.post(`/plans/${id}/experiments`, rest, options);
|
|
501
|
+
}
|
|
410
502
|
/** Update limits, overage, or enabled status of a feature on a plan. */
|
|
411
503
|
async updateFeature(params, options) {
|
|
412
504
|
const { id, featureId, ...rest } = params;
|
|
@@ -430,6 +522,61 @@ var PlansResource = class {
|
|
|
430
522
|
const { id, ...rest } = params;
|
|
431
523
|
return this.httpClient.post(`/plans/${id}/features`, rest, options);
|
|
432
524
|
}
|
|
525
|
+
/** Cancel a move for every subscriber who has not moved yet. They stay on their version; those already moved stay moved. */
|
|
526
|
+
async cancelMove(params, options) {
|
|
527
|
+
const { id, moveId } = params;
|
|
528
|
+
return this.httpClient.post(
|
|
529
|
+
`/plans/${id}/moves/${moveId}/cancel`,
|
|
530
|
+
{},
|
|
531
|
+
options
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
/** Read a move of subscribers between plan versions with each subscriber's status: moving, moved, needs a change, left out, canceled or kept on its version. */
|
|
535
|
+
async getMove(params, options) {
|
|
536
|
+
const { id, moveId } = params;
|
|
537
|
+
return this.httpClient.get(
|
|
538
|
+
`/plans/${id}/moves/${moveId}`,
|
|
539
|
+
void 0,
|
|
540
|
+
options
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
/** Cancel a move for one subscriber who has not moved yet. It stays on its version; the rest of the move continues. */
|
|
544
|
+
async cancelMoveSubscription(params, options) {
|
|
545
|
+
const { id, moveId, subscriptionId } = params;
|
|
546
|
+
return this.httpClient.post(
|
|
547
|
+
`/plans/${id}/moves/${moveId}/subscriptions/${subscriptionId}/cancel`,
|
|
548
|
+
{},
|
|
549
|
+
options
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
/** List a plan's latest moves of subscribers between versions, newest first, including the change of a single subscription, with how many are moving, moved, need a change, were left out, canceled or kept on their version. */
|
|
553
|
+
async listMoves(params, options) {
|
|
554
|
+
const { id } = params;
|
|
555
|
+
return this.httpClient.get(`/plans/${id}/moves`, void 0, options);
|
|
556
|
+
}
|
|
557
|
+
/** Move a list of subscriptions, or every subscription of another version, to a newer version of the plan, at their next renewal or now. Nobody moves unless every one of them fits or has a change in changes; otherwise the response lists each one with what would make it fit. Only active, trialing and past due subscriptions move. Paused ones, and listed subscriptions in another status or already on the destination, are left out. Send preview to check without moving anyone. */
|
|
558
|
+
async createMove(params, options) {
|
|
559
|
+
const { id, ...rest } = params;
|
|
560
|
+
return this.httpClient.post(`/plans/${id}/moves`, rest, options);
|
|
561
|
+
}
|
|
562
|
+
/** Leave a subscriber that needs a change on its version. It stops appearing among the subscribers that need a change; move it later like any other subscriber. */
|
|
563
|
+
async keepSubscriberOnVersion(params, options) {
|
|
564
|
+
const { id, subscriptionId } = params;
|
|
565
|
+
return this.httpClient.post(
|
|
566
|
+
`/plans/${id}/needs-a-change/${subscriptionId}/keep`,
|
|
567
|
+
{},
|
|
568
|
+
options
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
/** List the plan's subscribers whose move could not complete, with the version they stay on, the one they could not move to and why. Move them again with a change, or keep them on their version so they leave this list. */
|
|
572
|
+
async listSubscribersNeedingAChange(params, options) {
|
|
573
|
+
const { id } = params;
|
|
574
|
+
return this.httpClient.get(
|
|
575
|
+
`/plans/${id}/needs-a-change`,
|
|
576
|
+
void 0,
|
|
577
|
+
options
|
|
578
|
+
);
|
|
579
|
+
}
|
|
433
580
|
/** Set a specific price as the default and return the updated plan price. */
|
|
434
581
|
async setDefaultPrice(params, options) {
|
|
435
582
|
const { id, priceId } = params;
|
|
@@ -466,7 +613,7 @@ var PlansResource = class {
|
|
|
466
613
|
options
|
|
467
614
|
);
|
|
468
615
|
}
|
|
469
|
-
/** Archive a price for new subscriptions.
|
|
616
|
+
/** Archive a price for new subscriptions. This publishes a new version of the plan; existing subscriptions that selected the price keep paying it on their version until moved. */
|
|
470
617
|
async deletePrice(params, options) {
|
|
471
618
|
const { id, priceId } = params;
|
|
472
619
|
return this.httpClient.delete(
|
|
@@ -490,7 +637,7 @@ var PlansResource = class {
|
|
|
490
637
|
const { id } = params;
|
|
491
638
|
return this.httpClient.get(`/plans/${id}`, void 0, options);
|
|
492
639
|
}
|
|
493
|
-
/** Update a plan's name, description, visibility, default status, metadata, what happens to its unused plan credits, or its plan credit limit. */
|
|
640
|
+
/** Update a plan's name, description, visibility, default status, metadata, overage behavior, what happens to its unused plan credits or plan balance, or its plan credit or plan balance limit. */
|
|
494
641
|
async update(params, options) {
|
|
495
642
|
const { id, ...rest } = params;
|
|
496
643
|
return this.httpClient.patch(`/plans/${id}`, rest, options);
|
|
@@ -500,6 +647,34 @@ var PlansResource = class {
|
|
|
500
647
|
const { id } = params;
|
|
501
648
|
return this.httpClient.delete(`/plans/${id}`, void 0, options);
|
|
502
649
|
}
|
|
650
|
+
/** List what changes from one version of a plan to another: prices, trials, features, rules, add-ons, credit packs and countries. */
|
|
651
|
+
async compareVersions(params, options) {
|
|
652
|
+
const { id, versionId, ...rest } = params;
|
|
653
|
+
return this.httpClient.get(
|
|
654
|
+
`/plans/${id}/versions/${versionId}/changes`,
|
|
655
|
+
rest,
|
|
656
|
+
options
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
/** Get one published version of a plan with its prices and how many subscriptions are on it. */
|
|
660
|
+
async getVersion(params, options) {
|
|
661
|
+
const { id, versionId } = params;
|
|
662
|
+
return this.httpClient.get(
|
|
663
|
+
`/plans/${id}/versions/${versionId}`,
|
|
664
|
+
void 0,
|
|
665
|
+
options
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
/** List a plan's published versions, newest first, with their prices and how many subscriptions are on each. Versions published before Commet recorded every term are not listed. */
|
|
669
|
+
async listVersions(params, options) {
|
|
670
|
+
const { id, ...rest } = params;
|
|
671
|
+
return this.httpClient.get(`/plans/${id}/versions`, rest, options);
|
|
672
|
+
}
|
|
673
|
+
/** Publish a new current version of the plan from its current version, changing prices per interval, included credits or balance, per-currency amounts and the rollover cap. New buyers get it; every subscriber stays on its version until moved. To try changes without selling them to everyone, create an experiment instead. */
|
|
674
|
+
async createVersion(params, options) {
|
|
675
|
+
const { id, ...rest } = params;
|
|
676
|
+
return this.httpClient.post(`/plans/${id}/versions`, rest, options);
|
|
677
|
+
}
|
|
503
678
|
/** Set a plan's public visibility and return the updated plan. */
|
|
504
679
|
async setVisibility(params, options) {
|
|
505
680
|
const { id, ...rest } = params;
|
|
@@ -509,7 +684,7 @@ var PlansResource = class {
|
|
|
509
684
|
async list(params, options) {
|
|
510
685
|
return this.httpClient.get("/plans", params, options);
|
|
511
686
|
}
|
|
512
|
-
/** Create a new plan with optional consumption model, visibility, and plan
|
|
687
|
+
/** Create a new plan with optional consumption model, visibility, plan group assignment, overage behavior, and the rollover and spend limit of its plan credits or plan balance. */
|
|
513
688
|
async create(params, options) {
|
|
514
689
|
return this.httpClient.post("/plans", params, options);
|
|
515
690
|
}
|
|
@@ -634,12 +809,12 @@ var SubscriptionsResource = class {
|
|
|
634
809
|
options
|
|
635
810
|
);
|
|
636
811
|
}
|
|
637
|
-
/** Activate an add-on on a subscription. Charges a prorated amount for the current billing period. */
|
|
812
|
+
/** Activate an add-on on a subscription. Charges a prorated amount for the current billing period. An add-on that the subscription's plan version does not sell is rejected with addon_unavailable. */
|
|
638
813
|
async activateAddon(params, options) {
|
|
639
814
|
const { id, ...rest } = params;
|
|
640
815
|
return this.httpClient.post(`/subscriptions/${id}/addons`, rest, options);
|
|
641
816
|
}
|
|
642
|
-
/** Read whether the subscription
|
|
817
|
+
/** Read whether the subscription tops up automatically with its saved payment method when its available credits or balance reach a threshold, with the top-ups used this period and the last failure. */
|
|
643
818
|
async getAutoTopUp(params, options) {
|
|
644
819
|
const { id } = params;
|
|
645
820
|
return this.httpClient.get(
|
|
@@ -648,7 +823,7 @@ var SubscriptionsResource = class {
|
|
|
648
823
|
options
|
|
649
824
|
);
|
|
650
825
|
}
|
|
651
|
-
/** Turn automatic
|
|
826
|
+
/** Turn automatic top-ups on or off and set the threshold, the size of each top-up and the maximum top-ups per period. Send only the fields that change. On a credits plan each top-up buys `quantity` credits; on a balance plan it adds `amount` in minor units of the subscription currency, plus tax, and `threshold` is in the same minor units. Enabling requires a plan that sells credits or has balance top-ups on. The size must be at least the plan's minimum when auto top-up is enabled or when the size changes, so turning it off keeps working after the minimum rises. Saving it enabled resumes a paused auto top-up. */
|
|
652
827
|
async updateAutoTopUp(params, options) {
|
|
653
828
|
const { id, ...rest } = params;
|
|
654
829
|
return this.httpClient.patch(
|
|
@@ -666,7 +841,7 @@ var SubscriptionsResource = class {
|
|
|
666
841
|
options
|
|
667
842
|
);
|
|
668
843
|
}
|
|
669
|
-
/** Top up a subscription
|
|
844
|
+
/** Top up a balance subscription. Charges the customer's payment method for the amount plus tax, adds it to the subscription's purchased balance (after paying back any overage owed on the plan balance), creates its invoice and emits `balance.topped_up`. Purchased balance is spent after the plan balance and is kept until the subscription ends. Rejected with 400 when the subscription is not on a balance plan, its plan has top-ups turned off, or the amount is below the effective minimum: the plan's minimum top-up in the subscription currency, raised to the currency's minimum charge. */
|
|
670
845
|
async topupBalance(params, options) {
|
|
671
846
|
const { id, ...rest } = params;
|
|
672
847
|
return this.httpClient.post(
|
|
@@ -689,7 +864,16 @@ var SubscriptionsResource = class {
|
|
|
689
864
|
options
|
|
690
865
|
);
|
|
691
866
|
}
|
|
692
|
-
/**
|
|
867
|
+
/** Move a subscription to a newer published version of its plan, now or at the end of the period, without proration; an older version is rejected with version_not_newer, and a subscription on a running experiment moves only to a later version of that experiment. The subscription keeps its currency and its price: a destination that does not sell its currency is rejected with missing_regional_price, and one that does not sell the price it pays with price_not_found. A free version moves only to a free version and a paid one only to a paid one (validation_error). A subscription whose usage does not fit the destination, or with an active add-on the destination does not sell, is not moved either, and the error says why. Each change is recorded as a move of this one subscription in the plan's moves. Repeating the same request changes nothing; a new one replaces the pending move. */
|
|
868
|
+
async changeVersion(params, options) {
|
|
869
|
+
const { id, ...rest } = params;
|
|
870
|
+
return this.httpClient.post(
|
|
871
|
+
`/subscriptions/${id}/change-version`,
|
|
872
|
+
rest,
|
|
873
|
+
options
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
/** Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Charges the saved payment method and adds purchased credits. A credit pack that the subscription's plan version does not sell is rejected with credit_pack_unavailable. */
|
|
693
877
|
async purchaseCredits(params, options) {
|
|
694
878
|
const { id, ...rest } = params;
|
|
695
879
|
return this.httpClient.post(`/subscriptions/${id}/credits`, rest, options);
|
|
@@ -791,6 +975,15 @@ var SubscriptionsResource = class {
|
|
|
791
975
|
options
|
|
792
976
|
);
|
|
793
977
|
}
|
|
978
|
+
/** Cancel the move to another plan version pending for the next renewal, so the subscription stays on its version, and send subscription.version_change_canceled with reason canceled_by_merchant. A move made now has nothing pending to revoke. With nothing pending it changes nothing. Returns the subscription. */
|
|
979
|
+
async revokeScheduledVersionChange(params, options) {
|
|
980
|
+
const { id } = params;
|
|
981
|
+
return this.httpClient.delete(
|
|
982
|
+
`/subscriptions/${id}/scheduled-version-change`,
|
|
983
|
+
void 0,
|
|
984
|
+
options
|
|
985
|
+
);
|
|
986
|
+
}
|
|
794
987
|
/** Revert a scheduled cancellation and return the updated subscription. Only works before cancellation takes effect. */
|
|
795
988
|
async uncancel(params, options) {
|
|
796
989
|
const { id } = params;
|
|
@@ -1051,7 +1244,7 @@ var CommetValidationError = class extends CommetAPIError {
|
|
|
1051
1244
|
|
|
1052
1245
|
// src/version.ts
|
|
1053
1246
|
var API_VERSION = "2026-08-27";
|
|
1054
|
-
var SDK_VERSION = "9.
|
|
1247
|
+
var SDK_VERSION = "9.10.0";
|
|
1055
1248
|
|
|
1056
1249
|
// src/utils/telemetry.ts
|
|
1057
1250
|
var registeredIntegrations = /* @__PURE__ */ new Set();
|