autumn-js 1.2.45 → 1.2.47

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 (133) hide show
  1. package/dist/backend/adapters/express.js +9258 -8711
  2. package/dist/backend/adapters/express.mjs +5 -5
  3. package/dist/backend/adapters/fetch.js +9258 -8711
  4. package/dist/backend/adapters/fetch.mjs +5 -5
  5. package/dist/backend/adapters/hono.js +9258 -8711
  6. package/dist/backend/adapters/hono.mjs +5 -5
  7. package/dist/backend/adapters/index.js +9258 -8711
  8. package/dist/backend/adapters/index.mjs +8 -8
  9. package/dist/backend/adapters/next.js +9258 -8711
  10. package/dist/backend/adapters/next.mjs +5 -5
  11. package/dist/backend/{chunk-J2VZ3UZS.mjs → chunk-67VOIV5C.mjs} +1 -1
  12. package/dist/backend/{chunk-5DLBV5WP.mjs → chunk-77GKCX3Z.mjs} +2 -2
  13. package/dist/backend/chunk-HVAWZLIS.mjs +5908 -0
  14. package/dist/backend/{chunk-DY6WMOCT.mjs → chunk-I4AHQU6F.mjs} +2 -2
  15. package/dist/backend/{chunk-PVDDMLWT.mjs → chunk-JG66WX4B.mjs} +5384 -4990
  16. package/dist/backend/{chunk-P2TFPTAM.mjs → chunk-L6YI6MKA.mjs} +1 -1
  17. package/dist/backend/{chunk-67LHAREL.mjs → chunk-S6JJU673.mjs} +1 -1
  18. package/dist/backend/{chunk-L7N6FVEE.mjs → chunk-XTQXSCZZ.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 +9258 -8711
  22. package/dist/backend/core/handlers/coreHandler.mjs +3 -3
  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/handleRouteByName.js +9258 -8711
  26. package/dist/backend/core/handlers/handleRouteByName.mjs +3 -3
  27. package/dist/backend/core/handlers/index.d.mts +1 -1
  28. package/dist/backend/core/handlers/index.d.ts +1 -1
  29. package/dist/backend/core/handlers/index.js +9258 -8711
  30. package/dist/backend/core/handlers/index.mjs +4 -4
  31. package/dist/backend/core/index.d.mts +1 -1
  32. package/dist/backend/core/index.d.ts +1 -1
  33. package/dist/backend/core/index.js +9258 -8711
  34. package/dist/backend/core/index.mjs +4 -4
  35. package/dist/backend/core/routes/index.d.mts +1 -1
  36. package/dist/backend/core/routes/index.d.ts +1 -1
  37. package/dist/backend/core/routes/index.js +3844 -3691
  38. package/dist/backend/core/routes/index.mjs +1 -1
  39. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  40. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  41. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  43. package/dist/backend/core/routes/routeConfigs.js +3844 -3691
  44. package/dist/backend/core/routes/routeConfigs.mjs +1 -1
  45. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  46. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  47. package/dist/backend/core/types/index.d.mts +1 -1
  48. package/dist/backend/core/types/index.d.ts +1 -1
  49. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  50. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  51. package/dist/backend/index.d.mts +2 -2
  52. package/dist/backend/index.d.ts +2 -2
  53. package/dist/backend/index.js +9258 -8711
  54. package/dist/backend/index.mjs +4 -4
  55. package/dist/backend/{routeTypes-UN48tvoc.d.mts → routeTypes-D4za8Mi4.d.mts} +410 -30
  56. package/dist/backend/{routeTypes-COLvwrcx.d.ts → routeTypes-Dzcm4w8Y.d.ts} +410 -30
  57. package/dist/better-auth/{chunk-MOCG3CBD.mjs → chunk-APNGRMN6.mjs} +5385 -4991
  58. package/dist/better-auth/{chunk-3LKXO3EE.mjs → chunk-HEIFJSJZ.mjs} +1 -1
  59. package/dist/better-auth/chunk-RRPADBHG.mjs +5969 -0
  60. package/dist/better-auth/index.js +11545 -10998
  61. package/dist/better-auth/index.mjs +3 -3
  62. package/dist/better-auth/utils/createAutumnEndpoint.js +3844 -3691
  63. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  64. package/dist/better-auth/utils/handleBetterAuthRoute.js +9258 -8711
  65. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  66. package/dist/better-auth/utils/index.js +11545 -10998
  67. package/dist/better-auth/utils/index.mjs +3 -3
  68. package/dist/react/AutumnContext.d.mts +1 -1
  69. package/dist/react/AutumnContext.d.ts +1 -1
  70. package/dist/react/AutumnProvider.js +1 -1
  71. package/dist/react/AutumnProvider.mjs +2 -2
  72. package/dist/react/{chunk-EE3XPYSL.mjs → chunk-2C6RX3EW.mjs} +1 -1
  73. package/dist/react/{chunk-SBCI4L22.mjs → chunk-2X7HXG2W.mjs} +1 -1
  74. package/dist/react/{chunk-7SRCZYRC.mjs → chunk-3WU4ZFXU.mjs} +1 -1
  75. package/dist/react/{chunk-LUBYNTYC.mjs → chunk-4HU5BGSM.mjs} +1 -1
  76. package/dist/react/{chunk-RTZAB46K.mjs → chunk-7RF3IGDO.mjs} +1 -1
  77. package/dist/react/{chunk-KCOHZSS3.mjs → chunk-C6I2RW56.mjs} +8 -8
  78. package/dist/react/{chunk-CQF3ER2L.mjs → chunk-NWF7OFFQ.mjs} +2 -2
  79. package/dist/react/{chunk-CSJHU3F2.mjs → chunk-SRSYG5ZV.mjs} +1 -1
  80. package/dist/react/{chunk-QUGX6XRQ.mjs → chunk-UNQZV3K5.mjs} +1 -1
  81. package/dist/react/client/AutumnClient.d.mts +1 -1
  82. package/dist/react/client/AutumnClient.d.ts +1 -1
  83. package/dist/react/client/IAutumnClient.d.mts +1 -1
  84. package/dist/react/client/IAutumnClient.d.ts +1 -1
  85. package/dist/react/client/index.d.mts +1 -1
  86. package/dist/react/client/index.d.ts +1 -1
  87. package/dist/react/hooks/index.d.mts +1 -1
  88. package/dist/react/hooks/index.d.ts +1 -1
  89. package/dist/react/hooks/index.js +7 -7
  90. package/dist/react/hooks/index.mjs +8 -8
  91. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
  92. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
  93. package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
  94. package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
  95. package/dist/react/hooks/internal/useCustomerActions.js +1 -1
  96. package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
  97. package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
  98. package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
  99. package/dist/react/hooks/useAggregateEvents.js +7 -7
  100. package/dist/react/hooks/useAggregateEvents.mjs +2 -2
  101. package/dist/react/hooks/useCustomer.d.mts +1 -1
  102. package/dist/react/hooks/useCustomer.d.ts +1 -1
  103. package/dist/react/hooks/useCustomer.js +7 -7
  104. package/dist/react/hooks/useCustomer.mjs +3 -3
  105. package/dist/react/hooks/useEntity.d.mts +1 -1
  106. package/dist/react/hooks/useEntity.d.ts +1 -1
  107. package/dist/react/hooks/useEntity.js +7 -7
  108. package/dist/react/hooks/useEntity.mjs +2 -2
  109. package/dist/react/hooks/useListEvents.d.mts +1 -1
  110. package/dist/react/hooks/useListEvents.d.ts +1 -1
  111. package/dist/react/hooks/useListEvents.js +7 -7
  112. package/dist/react/hooks/useListEvents.mjs +2 -2
  113. package/dist/react/hooks/useListPlans.d.mts +1 -1
  114. package/dist/react/hooks/useListPlans.d.ts +1 -1
  115. package/dist/react/hooks/useListPlans.js +7 -7
  116. package/dist/react/hooks/useListPlans.mjs +2 -2
  117. package/dist/react/hooks/useReferrals.d.mts +1 -1
  118. package/dist/react/hooks/useReferrals.d.ts +1 -1
  119. package/dist/react/hooks/useReferrals.js +7 -7
  120. package/dist/react/hooks/useReferrals.mjs +2 -2
  121. package/dist/react/index.d.mts +1 -1
  122. package/dist/react/index.d.ts +1 -1
  123. package/dist/react/index.js +7 -7
  124. package/dist/react/index.mjs +9 -9
  125. package/dist/react/{params-DlzWLPN2.d.mts → params-BrFcJdeO.d.mts} +50 -4
  126. package/dist/react/{params-ChMwkOJA.d.ts → params-BwHZca3H.d.ts} +50 -4
  127. package/dist/sdk/index.d.mts +563 -43
  128. package/dist/sdk/index.d.ts +563 -43
  129. package/dist/sdk/index.js +7713 -7162
  130. package/dist/sdk/index.mjs +7643 -7146
  131. package/package.json +1 -1
  132. package/dist/backend/chunk-YKRFY5TK.mjs +0 -5755
  133. package/dist/better-auth/chunk-J3W4EO5H.mjs +0 -5816
@@ -10012,6 +10012,313 @@ type CreateReferralCodeResponse = {
10012
10012
  createdAt: number;
10013
10013
  };
10014
10014
 
10015
+ declare const DurationTypeRequestBody: {
10016
+ readonly OneOff: "one_off";
10017
+ readonly Months: "months";
10018
+ readonly Forever: "forever";
10019
+ };
10020
+ type DurationTypeRequestBody = ClosedEnum<typeof DurationTypeRequestBody>;
10021
+ /**
10022
+ * Use a positive integer length for months, and null for one_off or forever.
10023
+ */
10024
+ type CreateRewardDuration = {
10025
+ type: DurationTypeRequestBody;
10026
+ length: number | null;
10027
+ };
10028
+ type CreateRewardCouponPromoCode = {
10029
+ code: string;
10030
+ globalMaxRedemption?: number | null | undefined;
10031
+ firstTimeTransaction?: boolean | null | undefined;
10032
+ };
10033
+ declare const CouponTypeRequestBody: {
10034
+ readonly PercentageDiscount: "percentage_discount";
10035
+ readonly FixedDiscount: "fixed_discount";
10036
+ };
10037
+ type CouponTypeRequestBody = ClosedEnum<typeof CouponTypeRequestBody>;
10038
+ /**
10039
+ * Provide exactly one of coupon or feature_grant, not both.
10040
+ */
10041
+ type CreateRewardCouponRequest = {
10042
+ id: string;
10043
+ name: string;
10044
+ /**
10045
+ * Use a positive integer length for months, and null for one_off or forever.
10046
+ */
10047
+ duration: CreateRewardDuration;
10048
+ /**
10049
+ * Plan IDs must be unique.
10050
+ */
10051
+ planIds: Array<string> | null;
10052
+ /**
10053
+ * Promo code values must be unique.
10054
+ */
10055
+ promoCodes: Array<CreateRewardCouponPromoCode>;
10056
+ type: CouponTypeRequestBody;
10057
+ /**
10058
+ * Percentage discounts must be at most 100; fixed discounts must be positive.
10059
+ */
10060
+ value: number;
10061
+ };
10062
+ /**
10063
+ * The unit of time the grant lasts.
10064
+ */
10065
+ declare const ExpiryTypeRequestBody: {
10066
+ readonly Day: "day";
10067
+ readonly Week: "week";
10068
+ readonly Month: "month";
10069
+ readonly Year: "year";
10070
+ };
10071
+ /**
10072
+ * The unit of time the grant lasts.
10073
+ */
10074
+ type ExpiryTypeRequestBody = ClosedEnum<typeof ExpiryTypeRequestBody>;
10075
+ type ExpiryRequest = {
10076
+ /**
10077
+ * The unit of time the grant lasts.
10078
+ */
10079
+ type: ExpiryTypeRequestBody;
10080
+ /**
10081
+ * The positive integer count of periods before the grant expires.
10082
+ */
10083
+ length: number;
10084
+ };
10085
+ type CreateRewardGrant = {
10086
+ featureId: string;
10087
+ /**
10088
+ * A positive amount to grant, or null for boolean features.
10089
+ */
10090
+ included: number | null;
10091
+ expiry: ExpiryRequest | null;
10092
+ };
10093
+ type CreateRewardFeatureGrantPromoCode = {
10094
+ code: string;
10095
+ /**
10096
+ * A positive redemption limit, or null for unlimited uses.
10097
+ */
10098
+ maxUses: number | null;
10099
+ };
10100
+ /**
10101
+ * Provide exactly one of coupon or feature_grant, not both.
10102
+ */
10103
+ type CreateRewardFeatureGrantRequest = {
10104
+ id: string;
10105
+ name: string;
10106
+ /**
10107
+ * Feature IDs must be unique.
10108
+ */
10109
+ grants: Array<CreateRewardGrant>;
10110
+ /**
10111
+ * Promo code values must be unique.
10112
+ */
10113
+ promoCodes: Array<CreateRewardFeatureGrantPromoCode>;
10114
+ };
10115
+ type CreateRewardParams = {
10116
+ /**
10117
+ * Provide exactly one of coupon or feature_grant, not both.
10118
+ */
10119
+ coupon?: CreateRewardCouponRequest | undefined;
10120
+ /**
10121
+ * Provide exactly one of coupon or feature_grant, not both.
10122
+ */
10123
+ featureGrant?: CreateRewardFeatureGrantRequest | undefined;
10124
+ };
10125
+ /**
10126
+ * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
10127
+ */
10128
+ declare const CreateRewardCouponTypeResponse: {
10129
+ readonly PercentageDiscount: "percentage_discount";
10130
+ readonly FixedDiscount: "fixed_discount";
10131
+ readonly InvoiceCredits: "invoice_credits";
10132
+ };
10133
+ /**
10134
+ * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
10135
+ */
10136
+ type CreateRewardCouponTypeResponse = OpenEnum<typeof CreateRewardCouponTypeResponse>;
10137
+ /**
10138
+ * The unit of time the duration is measured in.
10139
+ */
10140
+ declare const CreateRewardDurationTypeResponse: {
10141
+ readonly OneOff: "one_off";
10142
+ readonly Months: "months";
10143
+ readonly Forever: "forever";
10144
+ };
10145
+ /**
10146
+ * The unit of time the duration is measured in.
10147
+ */
10148
+ type CreateRewardDurationTypeResponse = OpenEnum<typeof CreateRewardDurationTypeResponse>;
10149
+ /**
10150
+ * How long the coupon applies once redeemed.
10151
+ */
10152
+ type CreateRewardDurationResponse = {
10153
+ /**
10154
+ * The unit of time the duration is measured in.
10155
+ */
10156
+ type: CreateRewardDurationTypeResponse;
10157
+ /**
10158
+ * The number of `type` periods the duration lasts, or null when the type has no length (e.g. one_off, forever).
10159
+ */
10160
+ length: number | null;
10161
+ };
10162
+ type CreateRewardCouponPromoCodeResponse = {
10163
+ /**
10164
+ * The promo code customers enter to redeem the coupon.
10165
+ */
10166
+ code: string;
10167
+ /**
10168
+ * Maximum number of times this promo code can be redeemed across all customers, or null for unlimited.
10169
+ */
10170
+ globalMaxRedemption?: number | null | undefined;
10171
+ /**
10172
+ * Whether this promo code can only be applied to a customer's first transaction.
10173
+ */
10174
+ firstTimeTransaction?: boolean | null | undefined;
10175
+ };
10176
+ type CreateRewardCouponResponse = {
10177
+ /**
10178
+ * The unique identifier for the coupon.
10179
+ */
10180
+ id: string;
10181
+ /**
10182
+ * A human-readable name for the coupon.
10183
+ */
10184
+ name?: string | null | undefined;
10185
+ /**
10186
+ * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
10187
+ */
10188
+ type: CreateRewardCouponTypeResponse;
10189
+ /**
10190
+ * The discount value. A percentage for percentage_discount, or an amount for fixed_discount / invoice_credits.
10191
+ */
10192
+ value: number;
10193
+ /**
10194
+ * How long the coupon applies once redeemed.
10195
+ */
10196
+ duration: CreateRewardDurationResponse;
10197
+ /**
10198
+ * The plan IDs the coupon applies to, or null when it applies to all plans.
10199
+ */
10200
+ planIds: Array<string> | null;
10201
+ promoCodes: Array<CreateRewardCouponPromoCodeResponse>;
10202
+ /**
10203
+ * The Unix timestamp (in milliseconds) when the coupon was created.
10204
+ */
10205
+ createdAt: number;
10206
+ };
10207
+ /**
10208
+ * The unit of time the grant lasts.
10209
+ */
10210
+ declare const CreateRewardExpiryTypeResponse: {
10211
+ readonly Day: "day";
10212
+ readonly Week: "week";
10213
+ readonly Month: "month";
10214
+ readonly Year: "year";
10215
+ };
10216
+ /**
10217
+ * The unit of time the grant lasts.
10218
+ */
10219
+ type CreateRewardExpiryTypeResponse = OpenEnum<typeof CreateRewardExpiryTypeResponse>;
10220
+ type CreateRewardExpiryResponse = {
10221
+ /**
10222
+ * The unit of time the grant lasts.
10223
+ */
10224
+ type: CreateRewardExpiryTypeResponse;
10225
+ /**
10226
+ * The positive integer count of periods before the grant expires.
10227
+ */
10228
+ length: number;
10229
+ };
10230
+ type CreateRewardGrantResponse = {
10231
+ /**
10232
+ * The feature ID this grant applies to.
10233
+ */
10234
+ featureId: string;
10235
+ /**
10236
+ * The amount of the feature granted, or null for boolean features.
10237
+ */
10238
+ included: number | null;
10239
+ /**
10240
+ * How long the granted amount lasts before expiring, or null for a permanent grant.
10241
+ */
10242
+ expiry: CreateRewardExpiryResponse | null;
10243
+ };
10244
+ type CreateRewardFeatureGrantPromoCodeResponse = {
10245
+ /**
10246
+ * The promo code customers enter to redeem the feature grant.
10247
+ */
10248
+ code: string;
10249
+ /**
10250
+ * Maximum number of times this promo code can be redeemed, or null for unlimited.
10251
+ */
10252
+ maxUses: number | null;
10253
+ };
10254
+ type CreateRewardFeatureGrantResponse = {
10255
+ /**
10256
+ * The unique identifier for the feature grant.
10257
+ */
10258
+ id: string;
10259
+ /**
10260
+ * A human-readable name for the feature grant.
10261
+ */
10262
+ name?: string | null | undefined;
10263
+ grants: Array<CreateRewardGrantResponse>;
10264
+ promoCodes: Array<CreateRewardFeatureGrantPromoCodeResponse>;
10265
+ /**
10266
+ * The Unix timestamp (in milliseconds) when the feature grant was created.
10267
+ */
10268
+ createdAt: number;
10269
+ };
10270
+ /**
10271
+ * OK
10272
+ */
10273
+ type CreateRewardResponse = {
10274
+ coupon?: CreateRewardCouponResponse | undefined;
10275
+ featureGrant?: CreateRewardFeatureGrantResponse | undefined;
10276
+ };
10277
+
10278
+ /**
10279
+ * Unit of time for the trial ('day', 'month', 'year').
10280
+ */
10281
+ declare const CreateScheduleFreeTrialDurationType: {
10282
+ readonly Day: "day";
10283
+ readonly Month: "month";
10284
+ readonly Year: "year";
10285
+ };
10286
+ /**
10287
+ * Unit of time for the trial ('day', 'month', 'year').
10288
+ */
10289
+ type CreateScheduleFreeTrialDurationType = ClosedEnum<typeof CreateScheduleFreeTrialDurationType>;
10290
+ /**
10291
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
10292
+ */
10293
+ declare const CreateScheduleOnEnd: {
10294
+ readonly Bill: "bill";
10295
+ readonly Revert: "revert";
10296
+ };
10297
+ /**
10298
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
10299
+ */
10300
+ type CreateScheduleOnEnd = ClosedEnum<typeof CreateScheduleOnEnd>;
10301
+ /**
10302
+ * Free trial configuration for a plan.
10303
+ */
10304
+ type CreateScheduleFreeTrialParams = {
10305
+ /**
10306
+ * Number of duration_type periods the trial lasts.
10307
+ */
10308
+ durationLength: number;
10309
+ /**
10310
+ * Unit of time for the trial ('day', 'month', 'year').
10311
+ */
10312
+ durationType?: CreateScheduleFreeTrialDurationType | undefined;
10313
+ /**
10314
+ * If true, payment method required to start trial. Customer is charged after trial ends.
10315
+ */
10316
+ cardRequired?: boolean | undefined;
10317
+ /**
10318
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
10319
+ */
10320
+ onEnd?: CreateScheduleOnEnd | undefined;
10321
+ };
10015
10322
  /**
10016
10323
  * Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.
10017
10324
  */
@@ -10076,14 +10383,14 @@ type CreateScheduleBillingBehavior = ClosedEnum<typeof CreateScheduleBillingBeha
10076
10383
  /**
10077
10384
  * The duration unit to offset this phase from the prior phase.
10078
10385
  */
10079
- declare const CreateScheduleDurationType2: {
10386
+ declare const PhaseStartDurationType: {
10080
10387
  readonly Month: "month";
10081
10388
  readonly Year: "year";
10082
10389
  };
10083
10390
  /**
10084
10391
  * The duration unit to offset this phase from the prior phase.
10085
10392
  */
10086
- type CreateScheduleDurationType2 = ClosedEnum<typeof CreateScheduleDurationType2>;
10393
+ type PhaseStartDurationType = ClosedEnum<typeof PhaseStartDurationType>;
10087
10394
  /**
10088
10395
  * Relative start offset from the previous resolved schedule phase.
10089
10396
  */
@@ -10091,7 +10398,7 @@ type StartingAfter2 = {
10091
10398
  /**
10092
10399
  * The duration unit to offset this phase from the prior phase.
10093
10400
  */
10094
- durationType: CreateScheduleDurationType2;
10401
+ durationType: PhaseStartDurationType;
10095
10402
  /**
10096
10403
  * How many duration_type periods after the prior phase to start.
10097
10404
  */
@@ -10887,6 +11194,10 @@ type CreateSchedulePlan2 = {
10887
11194
  * The ID of the plan to schedule in this phase.
10888
11195
  */
10889
11196
  planId: string;
11197
+ /**
11198
+ * The immediate plan scope. Omit to inherit the request entity, pass null for customer-level, or pass an entity ID.
11199
+ */
11200
+ entityId?: string | null | undefined;
10890
11201
  /**
10891
11202
  * Optional prepaid feature quantities for this phase's plan.
10892
11203
  */
@@ -10941,6 +11252,14 @@ type CreateScheduleParams = {
10941
11252
  * Optional entity ID for an entity-scoped schedule.
10942
11253
  */
10943
11254
  entityId?: string | undefined;
11255
+ /**
11256
+ * Free trial configuration applied to every plan in the immediate phase.
11257
+ */
11258
+ freeTrial?: CreateScheduleFreeTrialParams | null | undefined;
11259
+ /**
11260
+ * Three-letter Stripe-supported currency code used to bill the immediate phase (for example, 'usd').
11261
+ */
11262
+ currency?: string | undefined;
10944
11263
  /**
10945
11264
  * Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.
10946
11265
  */
@@ -10975,6 +11294,10 @@ type CreateScheduleParams = {
10975
11294
  * If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed.
10976
11295
  */
10977
11296
  enablePlanImmediately?: boolean | undefined;
11297
+ /**
11298
+ * If true, active recurring add-ons in scopes represented by the phase plans are retained.
11299
+ */
11300
+ preserveAddOns?: boolean | undefined;
10978
11301
  /**
10979
11302
  * Ordered phase definitions for the schedule.
10980
11303
  */
@@ -18740,7 +19063,7 @@ type RewardsListParams = {};
18740
19063
  /**
18741
19064
  * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
18742
19065
  */
18743
- declare const CouponType: {
19066
+ declare const ListRewardsCouponType: {
18744
19067
  readonly PercentageDiscount: "percentage_discount";
18745
19068
  readonly FixedDiscount: "fixed_discount";
18746
19069
  readonly InvoiceCredits: "invoice_credits";
@@ -18748,11 +19071,11 @@ declare const CouponType: {
18748
19071
  /**
18749
19072
  * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
18750
19073
  */
18751
- type CouponType = OpenEnum<typeof CouponType>;
19074
+ type ListRewardsCouponType = OpenEnum<typeof ListRewardsCouponType>;
18752
19075
  /**
18753
19076
  * The unit of time the duration is measured in.
18754
19077
  */
18755
- declare const DurationType: {
19078
+ declare const ListRewardsDurationType: {
18756
19079
  readonly OneOff: "one_off";
18757
19080
  readonly Months: "months";
18758
19081
  readonly Forever: "forever";
@@ -18760,7 +19083,7 @@ declare const DurationType: {
18760
19083
  /**
18761
19084
  * The unit of time the duration is measured in.
18762
19085
  */
18763
- type DurationType = OpenEnum<typeof DurationType>;
19086
+ type ListRewardsDurationType = OpenEnum<typeof ListRewardsDurationType>;
18764
19087
  /**
18765
19088
  * How long the coupon applies once redeemed.
18766
19089
  */
@@ -18768,13 +19091,13 @@ type ListRewardsDuration = {
18768
19091
  /**
18769
19092
  * The unit of time the duration is measured in.
18770
19093
  */
18771
- type: DurationType;
19094
+ type: ListRewardsDurationType;
18772
19095
  /**
18773
19096
  * The number of `type` periods the duration lasts, or null when the type has no length (e.g. one_off, forever).
18774
19097
  */
18775
19098
  length: number | null;
18776
19099
  };
18777
- type CouponPromoCode = {
19100
+ type ListRewardsCouponPromoCode = {
18778
19101
  /**
18779
19102
  * The promo code customers enter to redeem the coupon.
18780
19103
  */
@@ -18800,7 +19123,7 @@ type Coupon = {
18800
19123
  /**
18801
19124
  * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
18802
19125
  */
18803
- type: CouponType;
19126
+ type: ListRewardsCouponType;
18804
19127
  /**
18805
19128
  * The discount value. A percentage for percentage_discount, or an amount for fixed_discount / invoice_credits.
18806
19129
  */
@@ -18816,36 +19139,36 @@ type Coupon = {
18816
19139
  /**
18817
19140
  * The promo codes customers can use to redeem the coupon.
18818
19141
  */
18819
- promoCodes: Array<CouponPromoCode>;
19142
+ promoCodes: Array<ListRewardsCouponPromoCode>;
18820
19143
  /**
18821
19144
  * The Unix timestamp (in milliseconds) when the coupon was created.
18822
19145
  */
18823
19146
  createdAt: number;
18824
19147
  };
18825
19148
  /**
18826
- * The unit of time the duration is measured in.
19149
+ * The unit of time the grant lasts.
18827
19150
  */
18828
- declare const ExpiryType: {
19151
+ declare const ListRewardsExpiryType: {
18829
19152
  readonly Day: "day";
18830
19153
  readonly Week: "week";
18831
19154
  readonly Month: "month";
18832
19155
  readonly Year: "year";
18833
19156
  };
18834
19157
  /**
18835
- * The unit of time the duration is measured in.
19158
+ * The unit of time the grant lasts.
18836
19159
  */
18837
- type ExpiryType = OpenEnum<typeof ExpiryType>;
18838
- type Expiry = {
19160
+ type ListRewardsExpiryType = OpenEnum<typeof ListRewardsExpiryType>;
19161
+ type ListRewardsExpiry = {
18839
19162
  /**
18840
- * The unit of time the duration is measured in.
19163
+ * The unit of time the grant lasts.
18841
19164
  */
18842
- type: ExpiryType;
19165
+ type: ListRewardsExpiryType;
18843
19166
  /**
18844
- * The number of `type` periods the duration lasts, or null when the type has no length (e.g. one_off, forever).
19167
+ * The positive integer count of periods before the grant expires.
18845
19168
  */
18846
- length: number | null;
19169
+ length: number;
18847
19170
  };
18848
- type Grant = {
19171
+ type ListRewardsGrant = {
18849
19172
  /**
18850
19173
  * The feature ID this grant applies to.
18851
19174
  */
@@ -18857,9 +19180,9 @@ type Grant = {
18857
19180
  /**
18858
19181
  * How long the granted amount lasts before expiring, or null for a permanent grant.
18859
19182
  */
18860
- expiry: Expiry | null;
19183
+ expiry: ListRewardsExpiry | null;
18861
19184
  };
18862
- type FeatureGrantPromoCode = {
19185
+ type ListRewardsFeatureGrantPromoCode = {
18863
19186
  /**
18864
19187
  * The promo code customers enter to redeem the feature grant.
18865
19188
  */
@@ -18881,11 +19204,11 @@ type FeatureGrant = {
18881
19204
  /**
18882
19205
  * The feature grants awarded when the grant is redeemed.
18883
19206
  */
18884
- grants: Array<Grant>;
19207
+ grants: Array<ListRewardsGrant>;
18885
19208
  /**
18886
19209
  * The promo codes customers can use to redeem the feature grant.
18887
19210
  */
18888
- promoCodes: Array<FeatureGrantPromoCode>;
19211
+ promoCodes: Array<ListRewardsFeatureGrantPromoCode>;
18889
19212
  /**
18890
19213
  * The Unix timestamp (in milliseconds) when the feature grant was created.
18891
19214
  */
@@ -19217,7 +19540,7 @@ type MultiAttachPlanItem = {
19217
19540
  rollover?: MultiAttachRollover | undefined;
19218
19541
  };
19219
19542
  /**
19220
- * Customize the plan to attach. Can override the price, items, or licenses.
19543
+ * Customize the plan to attach. Can override its price or items.
19221
19544
  */
19222
19545
  type MultiAttachCustomize = {
19223
19546
  /**
@@ -19252,7 +19575,7 @@ type MultiAttachPlan = {
19252
19575
  */
19253
19576
  planId: string;
19254
19577
  /**
19255
- * Customize the plan to attach. Can override the price, items, or licenses.
19578
+ * Customize the plan to attach. Can override its price or items.
19256
19579
  */
19257
19580
  customize?: MultiAttachCustomize | undefined;
19258
19581
  /**
@@ -19267,6 +19590,10 @@ type MultiAttachPlan = {
19267
19590
  * A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
19268
19591
  */
19269
19592
  subscriptionId?: string | undefined;
19593
+ /**
19594
+ * The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
19595
+ */
19596
+ entityId?: string | null | undefined;
19270
19597
  };
19271
19598
  /**
19272
19599
  * Unit of time for the trial ('day', 'month', 'year').
@@ -19350,6 +19677,17 @@ type MultiAttachAttachDiscount = {
19350
19677
  */
19351
19678
  promotionCode?: string | undefined;
19352
19679
  };
19680
+ /**
19681
+ * How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
19682
+ */
19683
+ declare const MultiAttachBillingBehavior: {
19684
+ readonly ProrateImmediately: "prorate_immediately";
19685
+ readonly None: "none";
19686
+ };
19687
+ /**
19688
+ * How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
19689
+ */
19690
+ type MultiAttachBillingBehavior = ClosedEnum<typeof MultiAttachBillingBehavior>;
19353
19691
  /**
19354
19692
  * Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.
19355
19693
  */
@@ -19535,6 +19873,10 @@ type MultiAttachParams = {
19535
19873
  * Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.
19536
19874
  */
19537
19875
  freeTrial?: MultiAttachFreeTrialParams | null | undefined;
19876
+ /**
19877
+ * Unix timestamp in milliseconds for backdating every plan in this multi-attach.
19878
+ */
19879
+ startsAt?: number | undefined;
19538
19880
  /**
19539
19881
  * Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
19540
19882
  */
@@ -19547,6 +19889,10 @@ type MultiAttachParams = {
19547
19889
  * List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
19548
19890
  */
19549
19891
  discounts?: Array<MultiAttachAttachDiscount> | undefined;
19892
+ /**
19893
+ * How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
19894
+ */
19895
+ billingBehavior?: MultiAttachBillingBehavior | undefined;
19550
19896
  /**
19551
19897
  * URL to redirect to after successful checkout.
19552
19898
  */
@@ -21905,7 +22251,7 @@ type PreviewMultiAttachPlanItem = {
21905
22251
  rollover?: PreviewMultiAttachRollover | undefined;
21906
22252
  };
21907
22253
  /**
21908
- * Customize the plan to attach. Can override the price, items, or licenses.
22254
+ * Customize the plan to attach. Can override its price or items.
21909
22255
  */
21910
22256
  type PreviewMultiAttachCustomize = {
21911
22257
  /**
@@ -21940,7 +22286,7 @@ type PreviewMultiAttachPlan = {
21940
22286
  */
21941
22287
  planId: string;
21942
22288
  /**
21943
- * Customize the plan to attach. Can override the price, items, or licenses.
22289
+ * Customize the plan to attach. Can override its price or items.
21944
22290
  */
21945
22291
  customize?: PreviewMultiAttachCustomize | undefined;
21946
22292
  /**
@@ -21955,6 +22301,10 @@ type PreviewMultiAttachPlan = {
21955
22301
  * A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
21956
22302
  */
21957
22303
  subscriptionId?: string | undefined;
22304
+ /**
22305
+ * The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
22306
+ */
22307
+ entityId?: string | null | undefined;
21958
22308
  };
21959
22309
  /**
21960
22310
  * Unit of time for the trial ('day', 'month', 'year').
@@ -22038,6 +22388,17 @@ type PreviewMultiAttachAttachDiscount = {
22038
22388
  */
22039
22389
  promotionCode?: string | undefined;
22040
22390
  };
22391
+ /**
22392
+ * How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
22393
+ */
22394
+ declare const PreviewMultiAttachBillingBehavior: {
22395
+ readonly ProrateImmediately: "prorate_immediately";
22396
+ readonly None: "none";
22397
+ };
22398
+ /**
22399
+ * How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
22400
+ */
22401
+ type PreviewMultiAttachBillingBehavior = ClosedEnum<typeof PreviewMultiAttachBillingBehavior>;
22041
22402
  /**
22042
22403
  * Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.
22043
22404
  */
@@ -22223,6 +22584,10 @@ type PreviewMultiAttachParams = {
22223
22584
  * Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.
22224
22585
  */
22225
22586
  freeTrial?: PreviewMultiAttachFreeTrialParams | null | undefined;
22587
+ /**
22588
+ * Unix timestamp in milliseconds for backdating every plan in this multi-attach.
22589
+ */
22590
+ startsAt?: number | undefined;
22226
22591
  /**
22227
22592
  * Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
22228
22593
  */
@@ -22235,6 +22600,10 @@ type PreviewMultiAttachParams = {
22235
22600
  * List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
22236
22601
  */
22237
22602
  discounts?: Array<PreviewMultiAttachAttachDiscount> | undefined;
22603
+ /**
22604
+ * How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
22605
+ */
22606
+ billingBehavior?: PreviewMultiAttachBillingBehavior | undefined;
22238
22607
  /**
22239
22608
  * URL to redirect to after successful checkout.
22240
22609
  */
@@ -31969,11 +32338,13 @@ declare class Billing extends ClientSDK {
31969
32338
  * @example
31970
32339
  * ```typescript
31971
32340
  * // Schedule a transition from a trial plan to a paid plan
31972
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785242875734,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786452475734,"plans":[{"planId":"pro_plan"}]}] });
32341
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":"now","plans":[{"planId":"trial_plan"}]},{"startingAfter":{"durationType":"month","durationCount":1},"plans":[{"planId":"pro_plan"}]}] });
31973
32342
  * ```
31974
32343
  *
31975
32344
  * @param customerId - The ID of the customer to create the schedule for.
31976
32345
  * @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
32346
+ * @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
32347
+ * @param currency - Three-letter Stripe-supported currency code used to bill the immediate phase (for example, 'usd'). (optional)
31977
32348
  * @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
31978
32349
  * @param discounts - List of discounts to apply to the immediate phase. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
31979
32350
  * @param successUrl - URL to redirect to after successful checkout. (optional)
@@ -31982,6 +32353,7 @@ declare class Billing extends ClientSDK {
31982
32353
  * @param billingBehavior - Whether to prorate the immediate phase. 'none' skips proration charges and credits. (optional)
31983
32354
  * @param billingCycleAnchor - Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time. (optional)
31984
32355
  * @param enablePlanImmediately - If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed. (optional)
32356
+ * @param preserveAddOns - If true, active recurring add-ons in scopes represented by the phase plans are retained. (optional)
31985
32357
  * @param phases - Ordered phase definitions for the schedule.
31986
32358
  *
31987
32359
  * @returns A create-schedule response with the schedule ID, persisted phases, and any required payment or checkout URL.
@@ -32014,9 +32386,11 @@ declare class Billing extends ClientSDK {
32014
32386
  * @param entityId - The ID of the entity to attach the plans to. (optional)
32015
32387
  * @param plans - The list of plans to attach to the customer.
32016
32388
  * @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
32389
+ * @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
32017
32390
  * @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
32018
32391
  * @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
32019
32392
  * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
32393
+ * @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
32020
32394
  * @param successUrl - URL to redirect to after successful checkout. (optional)
32021
32395
  * @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
32022
32396
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
@@ -32085,9 +32459,11 @@ declare class Billing extends ClientSDK {
32085
32459
  * @param entityId - The ID of the entity to attach the plans to. (optional)
32086
32460
  * @param plans - The list of plans to attach to the customer.
32087
32461
  * @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
32462
+ * @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
32088
32463
  * @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
32089
32464
  * @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
32090
32465
  * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
32466
+ * @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
32091
32467
  * @param successUrl - URL to redirect to after successful checkout. (optional)
32092
32468
  * @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
32093
32469
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
@@ -32809,6 +33185,10 @@ declare class Referrals extends ClientSDK {
32809
33185
  }
32810
33186
 
32811
33187
  declare class Rewards extends ClientSDK {
33188
+ /**
33189
+ * Create a coupon or feature grant.
33190
+ */
33191
+ create(request: CreateRewardParams, options?: RequestOptions): Promise<CreateRewardResponse>;
32812
33192
  /**
32813
33193
  * List the coupons and feature grants configured for the org.
32814
33194
  */