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
@@ -172,7 +172,7 @@ type EventsAggregateParams = {
172
172
  */
173
173
  featureId: string | Array<string>;
174
174
  /**
175
- * Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity_id" to group by those columns
175
+ * Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity_id" / "$plan_id" to group by those columns
176
176
  */
177
177
  groupBy?: string | undefined;
178
178
  /**
@@ -760,6 +760,17 @@ declare const AttachDurationType: {
760
760
  * Unit of time for the trial ('day', 'month', 'year').
761
761
  */
762
762
  type AttachDurationType = ClosedEnum<typeof AttachDurationType>;
763
+ /**
764
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
765
+ */
766
+ declare const AttachOnEnd: {
767
+ readonly Bill: "bill";
768
+ readonly Revert: "revert";
769
+ };
770
+ /**
771
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
772
+ */
773
+ type AttachOnEnd = ClosedEnum<typeof AttachOnEnd>;
763
774
  /**
764
775
  * Free trial configuration for a plan.
765
776
  */
@@ -776,6 +787,10 @@ type AttachFreeTrialParams = {
776
787
  * If true, payment method required to start trial. Customer is charged after trial ends.
777
788
  */
778
789
  cardRequired?: boolean | undefined;
790
+ /**
791
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
792
+ */
793
+ onEnd?: AttachOnEnd | undefined;
779
794
  };
780
795
  /**
781
796
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -1845,6 +1860,17 @@ declare const BillingUpdateDurationType: {
1845
1860
  * Unit of time for the trial ('day', 'month', 'year').
1846
1861
  */
1847
1862
  type BillingUpdateDurationType = ClosedEnum<typeof BillingUpdateDurationType>;
1863
+ /**
1864
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1865
+ */
1866
+ declare const BillingUpdateOnEnd: {
1867
+ readonly Bill: "bill";
1868
+ readonly Revert: "revert";
1869
+ };
1870
+ /**
1871
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1872
+ */
1873
+ type BillingUpdateOnEnd = ClosedEnum<typeof BillingUpdateOnEnd>;
1848
1874
  /**
1849
1875
  * Free trial configuration for a plan.
1850
1876
  */
@@ -1861,6 +1887,10 @@ type BillingUpdateFreeTrialParams = {
1861
1887
  * If true, payment method required to start trial. Customer is charged after trial ends.
1862
1888
  */
1863
1889
  cardRequired?: boolean | undefined;
1890
+ /**
1891
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
1892
+ */
1893
+ onEnd?: BillingUpdateOnEnd | undefined;
1864
1894
  };
1865
1895
  /**
1866
1896
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -2422,6 +2452,11 @@ declare const FreeTrialDuration2: {
2422
2452
  * The duration type of the free trial
2423
2453
  */
2424
2454
  type FreeTrialDuration2 = OpenEnum<typeof FreeTrialDuration2>;
2455
+ declare const CheckOnEnd2: {
2456
+ readonly Bill: "bill";
2457
+ readonly Revert: "revert";
2458
+ };
2459
+ type CheckOnEnd2 = OpenEnum<typeof CheckOnEnd2>;
2425
2460
  type CheckFreeTrial2 = {
2426
2461
  /**
2427
2462
  * The duration type of the free trial
@@ -2439,6 +2474,10 @@ type CheckFreeTrial2 = {
2439
2474
  * 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.
2440
2475
  */
2441
2476
  cardRequired: boolean;
2477
+ /**
2478
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
2479
+ */
2480
+ onEnd?: CheckOnEnd2 | null | undefined;
2442
2481
  /**
2443
2482
  * Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
2444
2483
  */
@@ -2878,6 +2917,11 @@ declare const FreeTrialDuration1: {
2878
2917
  * The duration type of the free trial
2879
2918
  */
2880
2919
  type FreeTrialDuration1 = OpenEnum<typeof FreeTrialDuration1>;
2920
+ declare const CheckOnEnd1: {
2921
+ readonly Bill: "bill";
2922
+ readonly Revert: "revert";
2923
+ };
2924
+ type CheckOnEnd1 = OpenEnum<typeof CheckOnEnd1>;
2881
2925
  type CheckFreeTrial1 = {
2882
2926
  /**
2883
2927
  * The duration type of the free trial
@@ -2895,6 +2939,10 @@ type CheckFreeTrial1 = {
2895
2939
  * 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.
2896
2940
  */
2897
2941
  cardRequired: boolean;
2942
+ /**
2943
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
2944
+ */
2945
+ onEnd?: CheckOnEnd1 | null | undefined;
2898
2946
  /**
2899
2947
  * Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
2900
2948
  */
@@ -3639,6 +3687,11 @@ declare const PlanDurationType: {
3639
3687
  * Unit of time for the trial duration ('day', 'month', 'year').
3640
3688
  */
3641
3689
  type PlanDurationType = OpenEnum<typeof PlanDurationType>;
3690
+ declare const OnEnd: {
3691
+ readonly Bill: "bill";
3692
+ readonly Revert: "revert";
3693
+ };
3694
+ type OnEnd = OpenEnum<typeof OnEnd>;
3642
3695
  /**
3643
3696
  * Free trial configuration. If set, new customers can try this plan before being charged.
3644
3697
  */
@@ -3655,6 +3708,10 @@ type FreeTrial = {
3655
3708
  * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
3656
3709
  */
3657
3710
  cardRequired: boolean;
3711
+ /**
3712
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
3713
+ */
3714
+ onEnd?: OnEnd | null | undefined;
3658
3715
  };
3659
3716
  /**
3660
3717
  * Environment this plan belongs to ('sandbox' or 'live').
@@ -4619,6 +4676,17 @@ declare const CreatePlanDurationTypeRequest: {
4619
4676
  * Unit of time for the trial ('day', 'month', 'year').
4620
4677
  */
4621
4678
  type CreatePlanDurationTypeRequest = ClosedEnum<typeof CreatePlanDurationTypeRequest>;
4679
+ /**
4680
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4681
+ */
4682
+ declare const CreatePlanOnEndRequest: {
4683
+ readonly Bill: "bill";
4684
+ readonly Revert: "revert";
4685
+ };
4686
+ /**
4687
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4688
+ */
4689
+ type CreatePlanOnEndRequest = ClosedEnum<typeof CreatePlanOnEndRequest>;
4622
4690
  /**
4623
4691
  * Free trial configuration. Customers can try this plan before being charged.
4624
4692
  */
@@ -4635,6 +4703,10 @@ type FreeTrialRequest = {
4635
4703
  * If true, payment method required to start trial. Customer is charged after trial ends.
4636
4704
  */
4637
4705
  cardRequired?: boolean | undefined;
4706
+ /**
4707
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
4708
+ */
4709
+ onEnd?: CreatePlanOnEndRequest | undefined;
4638
4710
  };
4639
4711
  /**
4640
4712
  * Miscellaneous plan-level configuration flags.
@@ -4978,6 +5050,11 @@ declare const CreatePlanDurationTypeResponse: {
4978
5050
  * Unit of time for the trial duration ('day', 'month', 'year').
4979
5051
  */
4980
5052
  type CreatePlanDurationTypeResponse = OpenEnum<typeof CreatePlanDurationTypeResponse>;
5053
+ declare const CreatePlanOnEndResponse: {
5054
+ readonly Bill: "bill";
5055
+ readonly Revert: "revert";
5056
+ };
5057
+ type CreatePlanOnEndResponse = OpenEnum<typeof CreatePlanOnEndResponse>;
4981
5058
  /**
4982
5059
  * Free trial configuration. If set, new customers can try this plan before being charged.
4983
5060
  */
@@ -4994,6 +5071,10 @@ type CreatePlanFreeTrialResponse = {
4994
5071
  * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
4995
5072
  */
4996
5073
  cardRequired: boolean;
5074
+ /**
5075
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
5076
+ */
5077
+ onEnd?: CreatePlanOnEndResponse | null | undefined;
4997
5078
  };
4998
5079
  /**
4999
5080
  * Environment this plan belongs to ('sandbox' or 'live').
@@ -7931,6 +8012,11 @@ declare const GetPlanDurationType: {
7931
8012
  * Unit of time for the trial duration ('day', 'month', 'year').
7932
8013
  */
7933
8014
  type GetPlanDurationType = OpenEnum<typeof GetPlanDurationType>;
8015
+ declare const GetPlanOnEnd: {
8016
+ readonly Bill: "bill";
8017
+ readonly Revert: "revert";
8018
+ };
8019
+ type GetPlanOnEnd = OpenEnum<typeof GetPlanOnEnd>;
7934
8020
  /**
7935
8021
  * Free trial configuration. If set, new customers can try this plan before being charged.
7936
8022
  */
@@ -7947,6 +8033,10 @@ type GetPlanFreeTrial = {
7947
8033
  * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
7948
8034
  */
7949
8035
  cardRequired: boolean;
8036
+ /**
8037
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
8038
+ */
8039
+ onEnd?: GetPlanOnEnd | null | undefined;
7950
8040
  };
7951
8041
  /**
7952
8042
  * Environment this plan belongs to ('sandbox' or 'live').
@@ -9648,6 +9738,11 @@ declare const ListPlansDurationType: {
9648
9738
  * Unit of time for the trial duration ('day', 'month', 'year').
9649
9739
  */
9650
9740
  type ListPlansDurationType = OpenEnum<typeof ListPlansDurationType>;
9741
+ declare const ListPlansOnEnd: {
9742
+ readonly Bill: "bill";
9743
+ readonly Revert: "revert";
9744
+ };
9745
+ type ListPlansOnEnd = OpenEnum<typeof ListPlansOnEnd>;
9651
9746
  /**
9652
9747
  * Free trial configuration. If set, new customers can try this plan before being charged.
9653
9748
  */
@@ -9664,6 +9759,10 @@ type ListPlansFreeTrial = {
9664
9759
  * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
9665
9760
  */
9666
9761
  cardRequired: boolean;
9762
+ /**
9763
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
9764
+ */
9765
+ onEnd?: ListPlansOnEnd | null | undefined;
9667
9766
  };
9668
9767
  /**
9669
9768
  * Environment this plan belongs to ('sandbox' or 'live').
@@ -10107,6 +10206,17 @@ declare const MultiAttachDurationType: {
10107
10206
  * Unit of time for the trial ('day', 'month', 'year').
10108
10207
  */
10109
10208
  type MultiAttachDurationType = ClosedEnum<typeof MultiAttachDurationType>;
10209
+ /**
10210
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
10211
+ */
10212
+ declare const MultiAttachOnEnd: {
10213
+ readonly Bill: "bill";
10214
+ readonly Revert: "revert";
10215
+ };
10216
+ /**
10217
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
10218
+ */
10219
+ type MultiAttachOnEnd = ClosedEnum<typeof MultiAttachOnEnd>;
10110
10220
  /**
10111
10221
  * Free trial configuration for a plan.
10112
10222
  */
@@ -10123,6 +10233,10 @@ type MultiAttachFreeTrialParams = {
10123
10233
  * If true, payment method required to start trial. Customer is charged after trial ends.
10124
10234
  */
10125
10235
  cardRequired?: boolean | undefined;
10236
+ /**
10237
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
10238
+ */
10239
+ onEnd?: MultiAttachOnEnd | undefined;
10126
10240
  };
10127
10241
  /**
10128
10242
  * Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
@@ -10929,6 +11043,17 @@ declare const PreviewAttachDurationType: {
10929
11043
  * Unit of time for the trial ('day', 'month', 'year').
10930
11044
  */
10931
11045
  type PreviewAttachDurationType = ClosedEnum<typeof PreviewAttachDurationType>;
11046
+ /**
11047
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
11048
+ */
11049
+ declare const PreviewAttachOnEnd: {
11050
+ readonly Bill: "bill";
11051
+ readonly Revert: "revert";
11052
+ };
11053
+ /**
11054
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
11055
+ */
11056
+ type PreviewAttachOnEnd = ClosedEnum<typeof PreviewAttachOnEnd>;
10932
11057
  /**
10933
11058
  * Free trial configuration for a plan.
10934
11059
  */
@@ -10945,6 +11070,10 @@ type PreviewAttachFreeTrialParams = {
10945
11070
  * If true, payment method required to start trial. Customer is charged after trial ends.
10946
11071
  */
10947
11072
  cardRequired?: boolean | undefined;
11073
+ /**
11074
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
11075
+ */
11076
+ onEnd?: PreviewAttachOnEnd | undefined;
10948
11077
  };
10949
11078
  /**
10950
11079
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -11824,6 +11953,17 @@ declare const PreviewMultiAttachDurationType: {
11824
11953
  * Unit of time for the trial ('day', 'month', 'year').
11825
11954
  */
11826
11955
  type PreviewMultiAttachDurationType = ClosedEnum<typeof PreviewMultiAttachDurationType>;
11956
+ /**
11957
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
11958
+ */
11959
+ declare const PreviewMultiAttachOnEnd: {
11960
+ readonly Bill: "bill";
11961
+ readonly Revert: "revert";
11962
+ };
11963
+ /**
11964
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
11965
+ */
11966
+ type PreviewMultiAttachOnEnd = ClosedEnum<typeof PreviewMultiAttachOnEnd>;
11827
11967
  /**
11828
11968
  * Free trial configuration for a plan.
11829
11969
  */
@@ -11840,6 +11980,10 @@ type PreviewMultiAttachFreeTrialParams = {
11840
11980
  * If true, payment method required to start trial. Customer is charged after trial ends.
11841
11981
  */
11842
11982
  cardRequired?: boolean | undefined;
11983
+ /**
11984
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
11985
+ */
11986
+ onEnd?: PreviewMultiAttachOnEnd | undefined;
11843
11987
  };
11844
11988
  /**
11845
11989
  * Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
@@ -12887,6 +13031,17 @@ declare const PreviewUpdateDurationType: {
12887
13031
  * Unit of time for the trial ('day', 'month', 'year').
12888
13032
  */
12889
13033
  type PreviewUpdateDurationType = ClosedEnum<typeof PreviewUpdateDurationType>;
13034
+ /**
13035
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
13036
+ */
13037
+ declare const PreviewUpdateOnEnd: {
13038
+ readonly Bill: "bill";
13039
+ readonly Revert: "revert";
13040
+ };
13041
+ /**
13042
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
13043
+ */
13044
+ type PreviewUpdateOnEnd = ClosedEnum<typeof PreviewUpdateOnEnd>;
12890
13045
  /**
12891
13046
  * Free trial configuration for a plan.
12892
13047
  */
@@ -12903,6 +13058,10 @@ type PreviewUpdateFreeTrialParams = {
12903
13058
  * If true, payment method required to start trial. Customer is charged after trial ends.
12904
13059
  */
12905
13060
  cardRequired?: boolean | undefined;
13061
+ /**
13062
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
13063
+ */
13064
+ onEnd?: PreviewUpdateOnEnd | undefined;
12906
13065
  };
12907
13066
  /**
12908
13067
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -13954,6 +14113,17 @@ declare const SetupPaymentDurationType: {
13954
14113
  * Unit of time for the trial ('day', 'month', 'year').
13955
14114
  */
13956
14115
  type SetupPaymentDurationType = ClosedEnum<typeof SetupPaymentDurationType>;
14116
+ /**
14117
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
14118
+ */
14119
+ declare const SetupPaymentOnEnd: {
14120
+ readonly Bill: "bill";
14121
+ readonly Revert: "revert";
14122
+ };
14123
+ /**
14124
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
14125
+ */
14126
+ type SetupPaymentOnEnd = ClosedEnum<typeof SetupPaymentOnEnd>;
13957
14127
  /**
13958
14128
  * Free trial configuration for a plan.
13959
14129
  */
@@ -13970,6 +14140,10 @@ type SetupPaymentFreeTrialParams = {
13970
14140
  * If true, payment method required to start trial. Customer is charged after trial ends.
13971
14141
  */
13972
14142
  cardRequired?: boolean | undefined;
14143
+ /**
14144
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
14145
+ */
14146
+ onEnd?: SetupPaymentOnEnd | undefined;
13973
14147
  };
13974
14148
  /**
13975
14149
  * Customize the plan to attach. Can override the price, items, free trial, or a combination.
@@ -15944,6 +16118,17 @@ declare const UpdatePlanDurationTypeRequest: {
15944
16118
  * Unit of time for the trial ('day', 'month', 'year').
15945
16119
  */
15946
16120
  type UpdatePlanDurationTypeRequest = ClosedEnum<typeof UpdatePlanDurationTypeRequest>;
16121
+ /**
16122
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
16123
+ */
16124
+ declare const UpdatePlanOnEndRequest: {
16125
+ readonly Bill: "bill";
16126
+ readonly Revert: "revert";
16127
+ };
16128
+ /**
16129
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
16130
+ */
16131
+ type UpdatePlanOnEndRequest = ClosedEnum<typeof UpdatePlanOnEndRequest>;
15947
16132
  /**
15948
16133
  * Free trial configuration for a plan.
15949
16134
  */
@@ -15960,6 +16145,10 @@ type UpdatePlanFreeTrialParams = {
15960
16145
  * If true, payment method required to start trial. Customer is charged after trial ends.
15961
16146
  */
15962
16147
  cardRequired?: boolean | undefined;
16148
+ /**
16149
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
16150
+ */
16151
+ onEnd?: UpdatePlanOnEndRequest | undefined;
15963
16152
  };
15964
16153
  /**
15965
16154
  * Miscellaneous plan-level configuration flags.
@@ -16306,6 +16495,11 @@ declare const UpdatePlanDurationTypeResponse: {
16306
16495
  * Unit of time for the trial duration ('day', 'month', 'year').
16307
16496
  */
16308
16497
  type UpdatePlanDurationTypeResponse = OpenEnum<typeof UpdatePlanDurationTypeResponse>;
16498
+ declare const UpdatePlanOnEndResponse: {
16499
+ readonly Bill: "bill";
16500
+ readonly Revert: "revert";
16501
+ };
16502
+ type UpdatePlanOnEndResponse = OpenEnum<typeof UpdatePlanOnEndResponse>;
16309
16503
  /**
16310
16504
  * Free trial configuration. If set, new customers can try this plan before being charged.
16311
16505
  */
@@ -16322,6 +16516,10 @@ type UpdatePlanFreeTrial = {
16322
16516
  * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
16323
16517
  */
16324
16518
  cardRequired: boolean;
16519
+ /**
16520
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
16521
+ */
16522
+ onEnd?: UpdatePlanOnEndResponse | null | undefined;
16325
16523
  };
16326
16524
  /**
16327
16525
  * Environment this plan belongs to ('sandbox' or 'live').
@@ -16707,7 +16905,7 @@ declare class Billing extends ClientSDK {
16707
16905
  * @example
16708
16906
  * ```typescript
16709
16907
  * // Schedule a transition from a trial plan to a paid plan
16710
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1778684108513,"plans":[{"planId":"trial_plan"}]},{"startsAt":1779893708513,"plans":[{"planId":"pro_plan"}]}] });
16908
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1778871536585,"plans":[{"planId":"trial_plan"}]},{"startsAt":1780081136585,"plans":[{"planId":"pro_plan"}]}] });
16711
16909
  * ```
16712
16910
  *
16713
16911
  * @param customerId - The ID of the customer to create the schedule for.
@@ -210,7 +210,8 @@ var attachPlanItemFilterOutboundSchema = z2.object({
210
210
  var attachFreeTrialParamsOutboundSchema = z2.object({
211
211
  duration_length: z2.number(),
212
212
  duration_type: z2.string(),
213
- card_required: z2.boolean()
213
+ card_required: z2.boolean(),
214
+ on_end: z2.union([z2.string(), z2.undefined()]).optional()
214
215
  });
215
216
  var attachCustomizeOutboundSchema = z2.object({
216
217
  price: z2.union([attachBasePriceOutboundSchema, z2.undefined()]).optional().nullable(),
@@ -363,10 +364,12 @@ var attachPlanItemFilterSchema = z2.object({
363
364
  interval: z2.union([attachRemoveItemIntervalSchema, z2.undefined()]).optional()
364
365
  });
365
366
  var attachDurationTypeSchema = closedEnumSchema2;
367
+ var attachOnEndSchema = closedEnumSchema2;
366
368
  var attachFreeTrialParamsSchema = z2.object({
367
369
  durationLength: z2.number(),
368
370
  durationType: z2.union([attachDurationTypeSchema, z2.undefined()]).optional(),
369
- cardRequired: z2.union([z2.boolean(), z2.undefined()]).optional()
371
+ cardRequired: z2.union([z2.boolean(), z2.undefined()]).optional(),
372
+ onEnd: z2.union([attachOnEndSchema, z2.undefined()]).optional()
370
373
  });
371
374
  var attachCustomizeSchema = z2.object({
372
375
  price: z2.union([attachBasePriceSchema, z2.undefined()]).optional().nullable(),
@@ -719,10 +722,12 @@ var listPlansItemSchema = z6.object({
719
722
  rollover: z6.union([listPlansRolloverSchema, z6.undefined()]).optional()
720
723
  });
721
724
  var listPlansDurationTypeSchema = openEnumSchema3;
725
+ var listPlansOnEndSchema = openEnumSchema3;
722
726
  var listPlansFreeTrialSchema = z6.object({
723
727
  durationLength: z6.number(),
724
728
  durationType: listPlansDurationTypeSchema,
725
- cardRequired: z6.boolean()
729
+ cardRequired: z6.boolean(),
730
+ onEnd: z6.union([listPlansOnEndSchema, z6.undefined()]).optional().nullable()
726
731
  });
727
732
  var listPlansEnvSchema = openEnumSchema3;
728
733
  var listPlansStatusSchema = openEnumSchema3;
@@ -860,7 +865,8 @@ var multiAttachPlanOutboundSchema = z7.object({
860
865
  var multiAttachFreeTrialParamsOutboundSchema = z7.object({
861
866
  duration_length: z7.number(),
862
867
  duration_type: z7.string(),
863
- card_required: z7.boolean()
868
+ card_required: z7.boolean(),
869
+ on_end: z7.union([z7.string(), z7.undefined()]).optional()
864
870
  });
865
871
  var multiAttachInvoiceModeOutboundSchema = z7.object({
866
872
  enabled: z7.boolean(),
@@ -959,10 +965,12 @@ var multiAttachPlanSchema = z7.object({
959
965
  subscriptionId: z7.union([z7.string(), z7.undefined()]).optional()
960
966
  });
961
967
  var multiAttachDurationTypeSchema = closedEnumSchema4;
968
+ var multiAttachOnEndSchema = closedEnumSchema4;
962
969
  var multiAttachFreeTrialParamsSchema = z7.object({
963
970
  durationLength: z7.number(),
964
971
  durationType: z7.union([multiAttachDurationTypeSchema, z7.undefined()]).optional(),
965
- cardRequired: z7.union([z7.boolean(), z7.undefined()]).optional()
972
+ cardRequired: z7.union([z7.boolean(), z7.undefined()]).optional(),
973
+ onEnd: z7.union([multiAttachOnEndSchema, z7.undefined()]).optional()
966
974
  });
967
975
  var multiAttachRedirectModeSchema = closedEnumSchema4;
968
976
  var multiAttachThresholdTypeSchema = closedEnumSchema4;
@@ -1262,7 +1270,8 @@ var previewAttachPlanItemFilterOutboundSchema = z9.object({
1262
1270
  var previewAttachFreeTrialParamsOutboundSchema = z9.object({
1263
1271
  duration_length: z9.number(),
1264
1272
  duration_type: z9.string(),
1265
- card_required: z9.boolean()
1273
+ card_required: z9.boolean(),
1274
+ on_end: z9.union([z9.string(), z9.undefined()]).optional()
1266
1275
  });
1267
1276
  var previewAttachCustomizeOutboundSchema = z9.object({
1268
1277
  price: z9.union([previewAttachBasePriceOutboundSchema, z9.undefined()]).optional().nullable(),
@@ -1419,10 +1428,12 @@ var previewAttachPlanItemFilterSchema = z9.object({
1419
1428
  interval: z9.union([previewAttachRemoveItemIntervalSchema, z9.undefined()]).optional()
1420
1429
  });
1421
1430
  var previewAttachDurationTypeSchema = closedEnumSchema5;
1431
+ var previewAttachOnEndSchema = closedEnumSchema5;
1422
1432
  var previewAttachFreeTrialParamsSchema = z9.object({
1423
1433
  durationLength: z9.number(),
1424
1434
  durationType: z9.union([previewAttachDurationTypeSchema, z9.undefined()]).optional(),
1425
- cardRequired: z9.union([z9.boolean(), z9.undefined()]).optional()
1435
+ cardRequired: z9.union([z9.boolean(), z9.undefined()]).optional(),
1436
+ onEnd: z9.union([previewAttachOnEndSchema, z9.undefined()]).optional()
1426
1437
  });
1427
1438
  var previewAttachCustomizeSchema = z9.object({
1428
1439
  price: z9.union([previewAttachBasePriceSchema, z9.undefined()]).optional().nullable(),
@@ -1676,7 +1687,8 @@ var previewMultiAttachPlanOutboundSchema = z10.object({
1676
1687
  var previewMultiAttachFreeTrialParamsOutboundSchema = z10.object({
1677
1688
  duration_length: z10.number(),
1678
1689
  duration_type: z10.string(),
1679
- card_required: z10.boolean()
1690
+ card_required: z10.boolean(),
1691
+ on_end: z10.union([z10.string(), z10.undefined()]).optional()
1680
1692
  });
1681
1693
  var previewMultiAttachInvoiceModeOutboundSchema = z10.object({
1682
1694
  enabled: z10.boolean(),
@@ -1782,10 +1794,12 @@ var previewMultiAttachPlanSchema = z10.object({
1782
1794
  subscriptionId: z10.union([z10.string(), z10.undefined()]).optional()
1783
1795
  });
1784
1796
  var previewMultiAttachDurationTypeSchema = closedEnumSchema6;
1797
+ var previewMultiAttachOnEndSchema = closedEnumSchema6;
1785
1798
  var previewMultiAttachFreeTrialParamsSchema = z10.object({
1786
1799
  durationLength: z10.number(),
1787
1800
  durationType: z10.union([previewMultiAttachDurationTypeSchema, z10.undefined()]).optional(),
1788
- cardRequired: z10.union([z10.boolean(), z10.undefined()]).optional()
1801
+ cardRequired: z10.union([z10.boolean(), z10.undefined()]).optional(),
1802
+ onEnd: z10.union([previewMultiAttachOnEndSchema, z10.undefined()]).optional()
1789
1803
  });
1790
1804
  var previewMultiAttachRedirectModeSchema = closedEnumSchema6;
1791
1805
  var previewMultiAttachThresholdTypeSchema = closedEnumSchema6;
@@ -2087,7 +2101,8 @@ var previewUpdatePlanItemFilterOutboundSchema = z11.object({
2087
2101
  var previewUpdateFreeTrialParamsOutboundSchema = z11.object({
2088
2102
  duration_length: z11.number(),
2089
2103
  duration_type: z11.string(),
2090
- card_required: z11.boolean()
2104
+ card_required: z11.boolean(),
2105
+ on_end: z11.union([z11.string(), z11.undefined()]).optional()
2091
2106
  });
2092
2107
  var previewUpdateCustomizeOutboundSchema = z11.object({
2093
2108
  price: z11.union([previewUpdateBasePriceOutboundSchema, z11.undefined()]).optional().nullable(),
@@ -2225,10 +2240,12 @@ var previewUpdatePlanItemFilterSchema = z11.object({
2225
2240
  interval: z11.union([previewUpdateRemoveItemIntervalSchema, z11.undefined()]).optional()
2226
2241
  });
2227
2242
  var previewUpdateDurationTypeSchema = closedEnumSchema7;
2243
+ var previewUpdateOnEndSchema = closedEnumSchema7;
2228
2244
  var previewUpdateFreeTrialParamsSchema = z11.object({
2229
2245
  durationLength: z11.number(),
2230
2246
  durationType: z11.union([previewUpdateDurationTypeSchema, z11.undefined()]).optional(),
2231
- cardRequired: z11.union([z11.boolean(), z11.undefined()]).optional()
2247
+ cardRequired: z11.union([z11.boolean(), z11.undefined()]).optional(),
2248
+ onEnd: z11.union([previewUpdateOnEndSchema, z11.undefined()]).optional()
2232
2249
  });
2233
2250
  var previewUpdateCustomizeSchema = z11.object({
2234
2251
  price: z11.union([previewUpdateBasePriceSchema, z11.undefined()]).optional().nullable(),
@@ -2461,7 +2478,8 @@ var setupPaymentPlanItemFilterOutboundSchema = z13.object({
2461
2478
  var setupPaymentFreeTrialParamsOutboundSchema = z13.object({
2462
2479
  duration_length: z13.number(),
2463
2480
  duration_type: z13.string(),
2464
- card_required: z13.boolean()
2481
+ card_required: z13.boolean(),
2482
+ on_end: z13.union([z13.string(), z13.undefined()]).optional()
2465
2483
  });
2466
2484
  var setupPaymentCustomizeOutboundSchema = z13.object({
2467
2485
  price: z13.union([setupPaymentBasePriceOutboundSchema, z13.undefined()]).optional().nullable(),
@@ -2604,10 +2622,12 @@ var setupPaymentPlanItemFilterSchema = z13.object({
2604
2622
  interval: z13.union([setupPaymentRemoveItemIntervalSchema, z13.undefined()]).optional()
2605
2623
  });
2606
2624
  var setupPaymentDurationTypeSchema = closedEnumSchema8;
2625
+ var setupPaymentOnEndSchema = closedEnumSchema8;
2607
2626
  var setupPaymentFreeTrialParamsSchema = z13.object({
2608
2627
  durationLength: z13.number(),
2609
2628
  durationType: z13.union([setupPaymentDurationTypeSchema, z13.undefined()]).optional(),
2610
- cardRequired: z13.union([z13.boolean(), z13.undefined()]).optional()
2629
+ cardRequired: z13.union([z13.boolean(), z13.undefined()]).optional(),
2630
+ onEnd: z13.union([setupPaymentOnEndSchema, z13.undefined()]).optional()
2611
2631
  });
2612
2632
  var setupPaymentCustomizeSchema = z13.object({
2613
2633
  price: z13.union([setupPaymentBasePriceSchema, z13.undefined()]).optional().nullable(),
@@ -2784,7 +2804,8 @@ var billingUpdatePlanItemFilterOutboundSchema = z14.object({
2784
2804
  var billingUpdateFreeTrialParamsOutboundSchema = z14.object({
2785
2805
  duration_length: z14.number(),
2786
2806
  duration_type: z14.string(),
2787
- card_required: z14.boolean()
2807
+ card_required: z14.boolean(),
2808
+ on_end: z14.union([z14.string(), z14.undefined()]).optional()
2788
2809
  });
2789
2810
  var billingUpdateCustomizeOutboundSchema = z14.object({
2790
2811
  price: z14.union([billingUpdateBasePriceOutboundSchema, z14.undefined()]).optional().nullable(),
@@ -2918,10 +2939,12 @@ var billingUpdatePlanItemFilterSchema = z14.object({
2918
2939
  interval: z14.union([billingUpdateRemoveItemIntervalSchema, z14.undefined()]).optional()
2919
2940
  });
2920
2941
  var billingUpdateDurationTypeSchema = closedEnumSchema9;
2942
+ var billingUpdateOnEndSchema = closedEnumSchema9;
2921
2943
  var billingUpdateFreeTrialParamsSchema = z14.object({
2922
2944
  durationLength: z14.number(),
2923
2945
  durationType: z14.union([billingUpdateDurationTypeSchema, z14.undefined()]).optional(),
2924
- cardRequired: z14.union([z14.boolean(), z14.undefined()]).optional()
2946
+ cardRequired: z14.union([z14.boolean(), z14.undefined()]).optional(),
2947
+ onEnd: z14.union([billingUpdateOnEndSchema, z14.undefined()]).optional()
2925
2948
  });
2926
2949
  var billingUpdateCustomizeSchema = z14.object({
2927
2950
  price: z14.union([billingUpdateBasePriceSchema, z14.undefined()]).optional().nullable(),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  routeConfigs
3
- } from "./chunk-X6KOCWP3.mjs";
3
+ } from "./chunk-3NU5LQBR.mjs";
4
4
  import {
5
5
  omitProtectedBodyFields
6
6
  } from "./chunk-GJAMWZNZ.mjs";