autumn-js 1.2.21 → 1.2.23

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.
Files changed (117) hide show
  1. package/dist/backend/adapters/express.js +181 -46
  2. package/dist/backend/adapters/express.mjs +9 -9
  3. package/dist/backend/adapters/fetch.js +181 -46
  4. package/dist/backend/adapters/fetch.mjs +9 -9
  5. package/dist/backend/adapters/hono.js +181 -46
  6. package/dist/backend/adapters/hono.mjs +9 -9
  7. package/dist/backend/adapters/index.js +181 -46
  8. package/dist/backend/adapters/index.mjs +12 -12
  9. package/dist/backend/adapters/next.js +181 -46
  10. package/dist/backend/adapters/next.mjs +9 -9
  11. package/dist/backend/{chunk-K2JSUNJX.mjs → chunk-7TQNAVUG.mjs} +1 -1
  12. package/dist/backend/{chunk-TGR2RWLO.mjs → chunk-K2ODGGAT.mjs} +1 -1
  13. package/dist/backend/{chunk-73KXFYFC.mjs → chunk-RKIVVLR3.mjs} +5 -5
  14. package/dist/backend/{chunk-GKYVE5XN.mjs → chunk-T4ZAR3BE.mjs} +143 -31
  15. package/dist/backend/{chunk-5JNYI5HM.mjs → chunk-UFAAJ5IV.mjs} +1 -1
  16. package/dist/backend/{chunk-NSHGFU5H.mjs → chunk-VHEQZSCT.mjs} +38 -15
  17. package/dist/backend/{chunk-H6KJYTJY.mjs → chunk-W5UYBM7S.mjs} +7 -7
  18. package/dist/backend/{chunk-NNIHXZQM.mjs → chunk-ZE23DYSY.mjs} +1 -1
  19. package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
  20. package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
  21. package/dist/backend/core/handlers/coreHandler.js +181 -46
  22. package/dist/backend/core/handlers/coreHandler.mjs +7 -7
  23. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  25. package/dist/backend/core/handlers/executeRoute.mjs +4 -4
  26. package/dist/backend/core/handlers/handleRouteByName.js +181 -46
  27. package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
  28. package/dist/backend/core/handlers/index.d.mts +1 -1
  29. package/dist/backend/core/handlers/index.d.ts +1 -1
  30. package/dist/backend/core/handlers/index.js +181 -46
  31. package/dist/backend/core/handlers/index.mjs +10 -10
  32. package/dist/backend/core/index.d.mts +1 -1
  33. package/dist/backend/core/index.d.ts +1 -1
  34. package/dist/backend/core/index.js +181 -46
  35. package/dist/backend/core/index.mjs +10 -10
  36. package/dist/backend/core/routes/index.d.mts +1 -1
  37. package/dist/backend/core/routes/index.d.ts +1 -1
  38. package/dist/backend/core/routes/index.js +38 -15
  39. package/dist/backend/core/routes/index.mjs +2 -2
  40. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  41. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  43. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  44. package/dist/backend/core/routes/routeConfigs.js +38 -15
  45. package/dist/backend/core/routes/routeConfigs.mjs +2 -2
  46. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  47. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  48. package/dist/backend/core/types/index.d.mts +1 -1
  49. package/dist/backend/core/types/index.d.ts +1 -1
  50. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  51. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  52. package/dist/backend/core/utils/index.mjs +3 -3
  53. package/dist/backend/index.d.mts +2 -2
  54. package/dist/backend/index.d.ts +2 -2
  55. package/dist/backend/index.js +181 -46
  56. package/dist/backend/index.mjs +10 -10
  57. package/dist/backend/{routeTypes-DZFxBYSb.d.mts → routeTypes-BBNqffnK.d.mts} +200 -2
  58. package/dist/backend/{routeTypes-B-Bkse9m.d.ts → routeTypes-D5CxGaFb.d.ts} +200 -2
  59. package/dist/better-auth/{chunk-X6KOCWP3.mjs → chunk-3NU5LQBR.mjs} +38 -15
  60. package/dist/better-auth/{chunk-R35KMMJZ.mjs → chunk-GPZQFANN.mjs} +1 -1
  61. package/dist/better-auth/{chunk-4OLXYKUC.mjs → chunk-VMKPVSFP.mjs} +144 -32
  62. package/dist/better-auth/index.js +181 -46
  63. package/dist/better-auth/index.mjs +3 -3
  64. package/dist/better-auth/utils/createAutumnEndpoint.js +38 -15
  65. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  66. package/dist/better-auth/utils/handleBetterAuthRoute.js +181 -46
  67. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  68. package/dist/better-auth/utils/index.js +181 -46
  69. package/dist/better-auth/utils/index.mjs +3 -3
  70. package/dist/react/AutumnContext.d.mts +3 -3
  71. package/dist/react/AutumnContext.d.ts +3 -3
  72. package/dist/react/client/AutumnClient.d.mts +3 -3
  73. package/dist/react/client/AutumnClient.d.ts +3 -3
  74. package/dist/react/client/IAutumnClient.d.mts +12 -3
  75. package/dist/react/client/IAutumnClient.d.ts +12 -3
  76. package/dist/react/client/index.d.mts +3 -3
  77. package/dist/react/client/index.d.ts +3 -3
  78. package/dist/react/{customer-DjlCjlmM.d.mts → customer-BTYGVzNm.d.mts} +1 -1
  79. package/dist/react/{customer-CzMuZp8W.d.ts → customer-zogPdrbc.d.ts} +1 -1
  80. package/dist/react/hooks/index.d.mts +3 -3
  81. package/dist/react/hooks/index.d.ts +3 -3
  82. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  83. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  84. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  85. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  86. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  87. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  88. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  89. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  90. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  91. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  92. package/dist/react/hooks/internal/useCustomerActions.d.mts +3 -3
  93. package/dist/react/hooks/internal/useCustomerActions.d.ts +3 -3
  94. package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
  95. package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
  96. package/dist/react/hooks/useCustomer.d.mts +3 -3
  97. package/dist/react/hooks/useCustomer.d.ts +3 -3
  98. package/dist/react/hooks/useEntity.d.mts +2 -2
  99. package/dist/react/hooks/useEntity.d.ts +2 -2
  100. package/dist/react/hooks/useListEvents.d.mts +2 -2
  101. package/dist/react/hooks/useListEvents.d.ts +2 -2
  102. package/dist/react/hooks/useListPlans.d.mts +2 -2
  103. package/dist/react/hooks/useListPlans.d.ts +2 -2
  104. package/dist/react/hooks/useReferrals.d.mts +2 -2
  105. package/dist/react/hooks/useReferrals.d.ts +2 -2
  106. package/dist/react/index.d.mts +3 -3
  107. package/dist/react/index.d.ts +3 -3
  108. package/dist/react/{params-BUQLwLrI.d.mts → params-BWA6FFXs.d.ts} +125 -2
  109. package/dist/react/{params-dYykqsvL.d.ts → params-Es9pSv7h.d.mts} +125 -2
  110. package/dist/react/{plan-DSTBzzTY.d.mts → plan-DYHM9lBi.d.mts} +9 -0
  111. package/dist/react/{plan-DSTBzzTY.d.ts → plan-DYHM9lBi.d.ts} +9 -0
  112. package/dist/sdk/index.d.mts +244 -5
  113. package/dist/sdk/index.d.ts +244 -5
  114. package/dist/sdk/index.js +175 -31
  115. package/dist/sdk/index.mjs +144 -32
  116. package/package.json +1 -1
  117. package/dist/backend/{chunk-S5HPMJ4U.mjs → chunk-55C2WWXQ.mjs} +3 -3
@@ -1,4 +1,4 @@
1
- import { C as ClosedEnum, O as OpenEnum, a as Balance, P as Plan } from './plan-DSTBzzTY.mjs';
1
+ import { C as ClosedEnum, O as OpenEnum, a as Balance, P as Plan } from './plan-DYHM9lBi.js';
2
2
 
3
3
  /**
4
4
  * Time range to aggregate events for. Either range or custom_range must be provided
@@ -49,7 +49,7 @@ type EventsAggregateParams = {
49
49
  */
50
50
  featureId: string | Array<string>;
51
51
  /**
52
- * Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity_id" to group by those columns
52
+ * Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity_id" / "$plan_id" to group by those columns
53
53
  */
54
54
  groupBy?: string | undefined;
55
55
  /**
@@ -637,6 +637,17 @@ declare const AttachDurationType: {
637
637
  * Unit of time for the trial ('day', 'month', 'year').
638
638
  */
639
639
  type AttachDurationType = ClosedEnum<typeof AttachDurationType>;
640
+ /**
641
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
642
+ */
643
+ declare const AttachOnEnd: {
644
+ readonly Bill: "bill";
645
+ readonly Revert: "revert";
646
+ };
647
+ /**
648
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
649
+ */
650
+ type AttachOnEnd = ClosedEnum<typeof AttachOnEnd>;
640
651
  /**
641
652
  * Free trial configuration for a plan.
642
653
  */
@@ -653,6 +664,10 @@ type AttachFreeTrialParams = {
653
664
  * If true, payment method required to start trial. Customer is charged after trial ends.
654
665
  */
655
666
  cardRequired?: boolean | undefined;
667
+ /**
668
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
669
+ */
670
+ onEnd?: AttachOnEnd | undefined;
656
671
  };
657
672
  /**
658
673
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -1477,6 +1492,17 @@ declare const BillingUpdateDurationType: {
1477
1492
  * Unit of time for the trial ('day', 'month', 'year').
1478
1493
  */
1479
1494
  type BillingUpdateDurationType = ClosedEnum<typeof BillingUpdateDurationType>;
1495
+ /**
1496
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1497
+ */
1498
+ declare const BillingUpdateOnEnd: {
1499
+ readonly Bill: "bill";
1500
+ readonly Revert: "revert";
1501
+ };
1502
+ /**
1503
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1504
+ */
1505
+ type BillingUpdateOnEnd = ClosedEnum<typeof BillingUpdateOnEnd>;
1480
1506
  /**
1481
1507
  * Free trial configuration for a plan.
1482
1508
  */
@@ -1493,6 +1519,10 @@ type BillingUpdateFreeTrialParams = {
1493
1519
  * If true, payment method required to start trial. Customer is charged after trial ends.
1494
1520
  */
1495
1521
  cardRequired?: boolean | undefined;
1522
+ /**
1523
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1524
+ */
1525
+ onEnd?: BillingUpdateOnEnd | undefined;
1496
1526
  };
1497
1527
  /**
1498
1528
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -2054,6 +2084,11 @@ declare const FreeTrialDuration2: {
2054
2084
  * The duration type of the free trial
2055
2085
  */
2056
2086
  type FreeTrialDuration2 = OpenEnum<typeof FreeTrialDuration2>;
2087
+ declare const CheckOnEnd2: {
2088
+ readonly Bill: "bill";
2089
+ readonly Revert: "revert";
2090
+ };
2091
+ type CheckOnEnd2 = OpenEnum<typeof CheckOnEnd2>;
2057
2092
  type CheckFreeTrial2 = {
2058
2093
  /**
2059
2094
  * The duration type of the free trial
@@ -2071,6 +2106,10 @@ type CheckFreeTrial2 = {
2071
2106
  * Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file.
2072
2107
  */
2073
2108
  cardRequired: boolean;
2109
+ /**
2110
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
2111
+ */
2112
+ onEnd?: CheckOnEnd2 | null | undefined;
2074
2113
  /**
2075
2114
  * Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
2076
2115
  */
@@ -2510,6 +2549,11 @@ declare const FreeTrialDuration1: {
2510
2549
  * The duration type of the free trial
2511
2550
  */
2512
2551
  type FreeTrialDuration1 = OpenEnum<typeof FreeTrialDuration1>;
2552
+ declare const CheckOnEnd1: {
2553
+ readonly Bill: "bill";
2554
+ readonly Revert: "revert";
2555
+ };
2556
+ type CheckOnEnd1 = OpenEnum<typeof CheckOnEnd1>;
2513
2557
  type CheckFreeTrial1 = {
2514
2558
  /**
2515
2559
  * The duration type of the free trial
@@ -2527,6 +2571,10 @@ type CheckFreeTrial1 = {
2527
2571
  * Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file.
2528
2572
  */
2529
2573
  cardRequired: boolean;
2574
+ /**
2575
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
2576
+ */
2577
+ onEnd?: CheckOnEnd1 | null | undefined;
2530
2578
  /**
2531
2579
  * Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
2532
2580
  */
@@ -3733,6 +3781,17 @@ declare const MultiAttachDurationType: {
3733
3781
  * Unit of time for the trial ('day', 'month', 'year').
3734
3782
  */
3735
3783
  type MultiAttachDurationType = ClosedEnum<typeof MultiAttachDurationType>;
3784
+ /**
3785
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
3786
+ */
3787
+ declare const MultiAttachOnEnd: {
3788
+ readonly Bill: "bill";
3789
+ readonly Revert: "revert";
3790
+ };
3791
+ /**
3792
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
3793
+ */
3794
+ type MultiAttachOnEnd = ClosedEnum<typeof MultiAttachOnEnd>;
3736
3795
  /**
3737
3796
  * Free trial configuration for a plan.
3738
3797
  */
@@ -3749,6 +3808,10 @@ type MultiAttachFreeTrialParams = {
3749
3808
  * If true, payment method required to start trial. Customer is charged after trial ends.
3750
3809
  */
3751
3810
  cardRequired?: boolean | undefined;
3811
+ /**
3812
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
3813
+ */
3814
+ onEnd?: MultiAttachOnEnd | undefined;
3752
3815
  };
3753
3816
  /**
3754
3817
  * Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
@@ -4555,6 +4618,17 @@ declare const PreviewAttachDurationType: {
4555
4618
  * Unit of time for the trial ('day', 'month', 'year').
4556
4619
  */
4557
4620
  type PreviewAttachDurationType = ClosedEnum<typeof PreviewAttachDurationType>;
4621
+ /**
4622
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4623
+ */
4624
+ declare const PreviewAttachOnEnd: {
4625
+ readonly Bill: "bill";
4626
+ readonly Revert: "revert";
4627
+ };
4628
+ /**
4629
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4630
+ */
4631
+ type PreviewAttachOnEnd = ClosedEnum<typeof PreviewAttachOnEnd>;
4558
4632
  /**
4559
4633
  * Free trial configuration for a plan.
4560
4634
  */
@@ -4571,6 +4645,10 @@ type PreviewAttachFreeTrialParams = {
4571
4645
  * If true, payment method required to start trial. Customer is charged after trial ends.
4572
4646
  */
4573
4647
  cardRequired?: boolean | undefined;
4648
+ /**
4649
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4650
+ */
4651
+ onEnd?: PreviewAttachOnEnd | undefined;
4574
4652
  };
4575
4653
  /**
4576
4654
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -5450,6 +5528,17 @@ declare const PreviewMultiAttachDurationType: {
5450
5528
  * Unit of time for the trial ('day', 'month', 'year').
5451
5529
  */
5452
5530
  type PreviewMultiAttachDurationType = ClosedEnum<typeof PreviewMultiAttachDurationType>;
5531
+ /**
5532
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
5533
+ */
5534
+ declare const PreviewMultiAttachOnEnd: {
5535
+ readonly Bill: "bill";
5536
+ readonly Revert: "revert";
5537
+ };
5538
+ /**
5539
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
5540
+ */
5541
+ type PreviewMultiAttachOnEnd = ClosedEnum<typeof PreviewMultiAttachOnEnd>;
5453
5542
  /**
5454
5543
  * Free trial configuration for a plan.
5455
5544
  */
@@ -5466,6 +5555,10 @@ type PreviewMultiAttachFreeTrialParams = {
5466
5555
  * If true, payment method required to start trial. Customer is charged after trial ends.
5467
5556
  */
5468
5557
  cardRequired?: boolean | undefined;
5558
+ /**
5559
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
5560
+ */
5561
+ onEnd?: PreviewMultiAttachOnEnd | undefined;
5469
5562
  };
5470
5563
  /**
5471
5564
  * Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
@@ -6513,6 +6606,17 @@ declare const PreviewUpdateDurationType: {
6513
6606
  * Unit of time for the trial ('day', 'month', 'year').
6514
6607
  */
6515
6608
  type PreviewUpdateDurationType = ClosedEnum<typeof PreviewUpdateDurationType>;
6609
+ /**
6610
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
6611
+ */
6612
+ declare const PreviewUpdateOnEnd: {
6613
+ readonly Bill: "bill";
6614
+ readonly Revert: "revert";
6615
+ };
6616
+ /**
6617
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
6618
+ */
6619
+ type PreviewUpdateOnEnd = ClosedEnum<typeof PreviewUpdateOnEnd>;
6516
6620
  /**
6517
6621
  * Free trial configuration for a plan.
6518
6622
  */
@@ -6529,6 +6633,10 @@ type PreviewUpdateFreeTrialParams = {
6529
6633
  * If true, payment method required to start trial. Customer is charged after trial ends.
6530
6634
  */
6531
6635
  cardRequired?: boolean | undefined;
6636
+ /**
6637
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
6638
+ */
6639
+ onEnd?: PreviewUpdateOnEnd | undefined;
6532
6640
  };
6533
6641
  /**
6534
6642
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -7580,6 +7688,17 @@ declare const SetupPaymentDurationType: {
7580
7688
  * Unit of time for the trial ('day', 'month', 'year').
7581
7689
  */
7582
7690
  type SetupPaymentDurationType = ClosedEnum<typeof SetupPaymentDurationType>;
7691
+ /**
7692
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
7693
+ */
7694
+ declare const SetupPaymentOnEnd: {
7695
+ readonly Bill: "bill";
7696
+ readonly Revert: "revert";
7697
+ };
7698
+ /**
7699
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
7700
+ */
7701
+ type SetupPaymentOnEnd = ClosedEnum<typeof SetupPaymentOnEnd>;
7583
7702
  /**
7584
7703
  * Free trial configuration for a plan.
7585
7704
  */
@@ -7596,6 +7715,10 @@ type SetupPaymentFreeTrialParams = {
7596
7715
  * If true, payment method required to start trial. Customer is charged after trial ends.
7597
7716
  */
7598
7717
  cardRequired?: boolean | undefined;
7718
+ /**
7719
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
7720
+ */
7721
+ onEnd?: SetupPaymentOnEnd | undefined;
7599
7722
  };
7600
7723
  /**
7601
7724
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -1,4 +1,4 @@
1
- import { C as ClosedEnum, O as OpenEnum, a as Balance, P as Plan } from './plan-DSTBzzTY.js';
1
+ import { C as ClosedEnum, O as OpenEnum, a as Balance, P as Plan } from './plan-DYHM9lBi.mjs';
2
2
 
3
3
  /**
4
4
  * Time range to aggregate events for. Either range or custom_range must be provided
@@ -49,7 +49,7 @@ type EventsAggregateParams = {
49
49
  */
50
50
  featureId: string | Array<string>;
51
51
  /**
52
- * Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity_id" to group by those columns
52
+ * Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity_id" / "$plan_id" to group by those columns
53
53
  */
54
54
  groupBy?: string | undefined;
55
55
  /**
@@ -637,6 +637,17 @@ declare const AttachDurationType: {
637
637
  * Unit of time for the trial ('day', 'month', 'year').
638
638
  */
639
639
  type AttachDurationType = ClosedEnum<typeof AttachDurationType>;
640
+ /**
641
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
642
+ */
643
+ declare const AttachOnEnd: {
644
+ readonly Bill: "bill";
645
+ readonly Revert: "revert";
646
+ };
647
+ /**
648
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
649
+ */
650
+ type AttachOnEnd = ClosedEnum<typeof AttachOnEnd>;
640
651
  /**
641
652
  * Free trial configuration for a plan.
642
653
  */
@@ -653,6 +664,10 @@ type AttachFreeTrialParams = {
653
664
  * If true, payment method required to start trial. Customer is charged after trial ends.
654
665
  */
655
666
  cardRequired?: boolean | undefined;
667
+ /**
668
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
669
+ */
670
+ onEnd?: AttachOnEnd | undefined;
656
671
  };
657
672
  /**
658
673
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -1477,6 +1492,17 @@ declare const BillingUpdateDurationType: {
1477
1492
  * Unit of time for the trial ('day', 'month', 'year').
1478
1493
  */
1479
1494
  type BillingUpdateDurationType = ClosedEnum<typeof BillingUpdateDurationType>;
1495
+ /**
1496
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1497
+ */
1498
+ declare const BillingUpdateOnEnd: {
1499
+ readonly Bill: "bill";
1500
+ readonly Revert: "revert";
1501
+ };
1502
+ /**
1503
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1504
+ */
1505
+ type BillingUpdateOnEnd = ClosedEnum<typeof BillingUpdateOnEnd>;
1480
1506
  /**
1481
1507
  * Free trial configuration for a plan.
1482
1508
  */
@@ -1493,6 +1519,10 @@ type BillingUpdateFreeTrialParams = {
1493
1519
  * If true, payment method required to start trial. Customer is charged after trial ends.
1494
1520
  */
1495
1521
  cardRequired?: boolean | undefined;
1522
+ /**
1523
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1524
+ */
1525
+ onEnd?: BillingUpdateOnEnd | undefined;
1496
1526
  };
1497
1527
  /**
1498
1528
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -2054,6 +2084,11 @@ declare const FreeTrialDuration2: {
2054
2084
  * The duration type of the free trial
2055
2085
  */
2056
2086
  type FreeTrialDuration2 = OpenEnum<typeof FreeTrialDuration2>;
2087
+ declare const CheckOnEnd2: {
2088
+ readonly Bill: "bill";
2089
+ readonly Revert: "revert";
2090
+ };
2091
+ type CheckOnEnd2 = OpenEnum<typeof CheckOnEnd2>;
2057
2092
  type CheckFreeTrial2 = {
2058
2093
  /**
2059
2094
  * The duration type of the free trial
@@ -2071,6 +2106,10 @@ type CheckFreeTrial2 = {
2071
2106
  * Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file.
2072
2107
  */
2073
2108
  cardRequired: boolean;
2109
+ /**
2110
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
2111
+ */
2112
+ onEnd?: CheckOnEnd2 | null | undefined;
2074
2113
  /**
2075
2114
  * Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
2076
2115
  */
@@ -2510,6 +2549,11 @@ declare const FreeTrialDuration1: {
2510
2549
  * The duration type of the free trial
2511
2550
  */
2512
2551
  type FreeTrialDuration1 = OpenEnum<typeof FreeTrialDuration1>;
2552
+ declare const CheckOnEnd1: {
2553
+ readonly Bill: "bill";
2554
+ readonly Revert: "revert";
2555
+ };
2556
+ type CheckOnEnd1 = OpenEnum<typeof CheckOnEnd1>;
2513
2557
  type CheckFreeTrial1 = {
2514
2558
  /**
2515
2559
  * The duration type of the free trial
@@ -2527,6 +2571,10 @@ type CheckFreeTrial1 = {
2527
2571
  * Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file.
2528
2572
  */
2529
2573
  cardRequired: boolean;
2574
+ /**
2575
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
2576
+ */
2577
+ onEnd?: CheckOnEnd1 | null | undefined;
2530
2578
  /**
2531
2579
  * Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
2532
2580
  */
@@ -3733,6 +3781,17 @@ declare const MultiAttachDurationType: {
3733
3781
  * Unit of time for the trial ('day', 'month', 'year').
3734
3782
  */
3735
3783
  type MultiAttachDurationType = ClosedEnum<typeof MultiAttachDurationType>;
3784
+ /**
3785
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
3786
+ */
3787
+ declare const MultiAttachOnEnd: {
3788
+ readonly Bill: "bill";
3789
+ readonly Revert: "revert";
3790
+ };
3791
+ /**
3792
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
3793
+ */
3794
+ type MultiAttachOnEnd = ClosedEnum<typeof MultiAttachOnEnd>;
3736
3795
  /**
3737
3796
  * Free trial configuration for a plan.
3738
3797
  */
@@ -3749,6 +3808,10 @@ type MultiAttachFreeTrialParams = {
3749
3808
  * If true, payment method required to start trial. Customer is charged after trial ends.
3750
3809
  */
3751
3810
  cardRequired?: boolean | undefined;
3811
+ /**
3812
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
3813
+ */
3814
+ onEnd?: MultiAttachOnEnd | undefined;
3752
3815
  };
3753
3816
  /**
3754
3817
  * Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
@@ -4555,6 +4618,17 @@ declare const PreviewAttachDurationType: {
4555
4618
  * Unit of time for the trial ('day', 'month', 'year').
4556
4619
  */
4557
4620
  type PreviewAttachDurationType = ClosedEnum<typeof PreviewAttachDurationType>;
4621
+ /**
4622
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4623
+ */
4624
+ declare const PreviewAttachOnEnd: {
4625
+ readonly Bill: "bill";
4626
+ readonly Revert: "revert";
4627
+ };
4628
+ /**
4629
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4630
+ */
4631
+ type PreviewAttachOnEnd = ClosedEnum<typeof PreviewAttachOnEnd>;
4558
4632
  /**
4559
4633
  * Free trial configuration for a plan.
4560
4634
  */
@@ -4571,6 +4645,10 @@ type PreviewAttachFreeTrialParams = {
4571
4645
  * If true, payment method required to start trial. Customer is charged after trial ends.
4572
4646
  */
4573
4647
  cardRequired?: boolean | undefined;
4648
+ /**
4649
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4650
+ */
4651
+ onEnd?: PreviewAttachOnEnd | undefined;
4574
4652
  };
4575
4653
  /**
4576
4654
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -5450,6 +5528,17 @@ declare const PreviewMultiAttachDurationType: {
5450
5528
  * Unit of time for the trial ('day', 'month', 'year').
5451
5529
  */
5452
5530
  type PreviewMultiAttachDurationType = ClosedEnum<typeof PreviewMultiAttachDurationType>;
5531
+ /**
5532
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
5533
+ */
5534
+ declare const PreviewMultiAttachOnEnd: {
5535
+ readonly Bill: "bill";
5536
+ readonly Revert: "revert";
5537
+ };
5538
+ /**
5539
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
5540
+ */
5541
+ type PreviewMultiAttachOnEnd = ClosedEnum<typeof PreviewMultiAttachOnEnd>;
5453
5542
  /**
5454
5543
  * Free trial configuration for a plan.
5455
5544
  */
@@ -5466,6 +5555,10 @@ type PreviewMultiAttachFreeTrialParams = {
5466
5555
  * If true, payment method required to start trial. Customer is charged after trial ends.
5467
5556
  */
5468
5557
  cardRequired?: boolean | undefined;
5558
+ /**
5559
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
5560
+ */
5561
+ onEnd?: PreviewMultiAttachOnEnd | undefined;
5469
5562
  };
5470
5563
  /**
5471
5564
  * Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
@@ -6513,6 +6606,17 @@ declare const PreviewUpdateDurationType: {
6513
6606
  * Unit of time for the trial ('day', 'month', 'year').
6514
6607
  */
6515
6608
  type PreviewUpdateDurationType = ClosedEnum<typeof PreviewUpdateDurationType>;
6609
+ /**
6610
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
6611
+ */
6612
+ declare const PreviewUpdateOnEnd: {
6613
+ readonly Bill: "bill";
6614
+ readonly Revert: "revert";
6615
+ };
6616
+ /**
6617
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
6618
+ */
6619
+ type PreviewUpdateOnEnd = ClosedEnum<typeof PreviewUpdateOnEnd>;
6516
6620
  /**
6517
6621
  * Free trial configuration for a plan.
6518
6622
  */
@@ -6529,6 +6633,10 @@ type PreviewUpdateFreeTrialParams = {
6529
6633
  * If true, payment method required to start trial. Customer is charged after trial ends.
6530
6634
  */
6531
6635
  cardRequired?: boolean | undefined;
6636
+ /**
6637
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
6638
+ */
6639
+ onEnd?: PreviewUpdateOnEnd | undefined;
6532
6640
  };
6533
6641
  /**
6534
6642
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -7580,6 +7688,17 @@ declare const SetupPaymentDurationType: {
7580
7688
  * Unit of time for the trial ('day', 'month', 'year').
7581
7689
  */
7582
7690
  type SetupPaymentDurationType = ClosedEnum<typeof SetupPaymentDurationType>;
7691
+ /**
7692
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
7693
+ */
7694
+ declare const SetupPaymentOnEnd: {
7695
+ readonly Bill: "bill";
7696
+ readonly Revert: "revert";
7697
+ };
7698
+ /**
7699
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
7700
+ */
7701
+ type SetupPaymentOnEnd = ClosedEnum<typeof SetupPaymentOnEnd>;
7583
7702
  /**
7584
7703
  * Free trial configuration for a plan.
7585
7704
  */
@@ -7596,6 +7715,10 @@ type SetupPaymentFreeTrialParams = {
7596
7715
  * If true, payment method required to start trial. Customer is charged after trial ends.
7597
7716
  */
7598
7717
  cardRequired?: boolean | undefined;
7718
+ /**
7719
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
7720
+ */
7721
+ onEnd?: SetupPaymentOnEnd | undefined;
7599
7722
  };
7600
7723
  /**
7601
7724
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -541,6 +541,11 @@ declare const PlanDurationType: {
541
541
  * Unit of time for the trial duration ('day', 'month', 'year').
542
542
  */
543
543
  type PlanDurationType = OpenEnum<typeof PlanDurationType>;
544
+ declare const OnEnd: {
545
+ readonly Bill: "bill";
546
+ readonly Revert: "revert";
547
+ };
548
+ type OnEnd = OpenEnum<typeof OnEnd>;
544
549
  /**
545
550
  * Free trial configuration. If set, new customers can try this plan before being charged.
546
551
  */
@@ -557,6 +562,10 @@ type FreeTrial = {
557
562
  * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
558
563
  */
559
564
  cardRequired: boolean;
565
+ /**
566
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
567
+ */
568
+ onEnd?: OnEnd | null | undefined;
560
569
  };
561
570
  /**
562
571
  * Environment this plan belongs to ('sandbox' or 'live').
@@ -541,6 +541,11 @@ declare const PlanDurationType: {
541
541
  * Unit of time for the trial duration ('day', 'month', 'year').
542
542
  */
543
543
  type PlanDurationType = OpenEnum<typeof PlanDurationType>;
544
+ declare const OnEnd: {
545
+ readonly Bill: "bill";
546
+ readonly Revert: "revert";
547
+ };
548
+ type OnEnd = OpenEnum<typeof OnEnd>;
544
549
  /**
545
550
  * Free trial configuration. If set, new customers can try this plan before being charged.
546
551
  */
@@ -557,6 +562,10 @@ type FreeTrial = {
557
562
  * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
558
563
  */
559
564
  cardRequired: boolean;
565
+ /**
566
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
567
+ */
568
+ onEnd?: OnEnd | null | undefined;
560
569
  };
561
570
  /**
562
571
  * Environment this plan belongs to ('sandbox' or 'live').