autumn-js 1.2.46 → 1.2.48

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 (77) hide show
  1. package/dist/backend/adapters/express.js +9189 -8533
  2. package/dist/backend/adapters/express.mjs +9 -9
  3. package/dist/backend/adapters/fetch.js +9189 -8533
  4. package/dist/backend/adapters/fetch.mjs +9 -9
  5. package/dist/backend/adapters/hono.js +9189 -8533
  6. package/dist/backend/adapters/hono.mjs +9 -9
  7. package/dist/backend/adapters/index.js +9189 -8533
  8. package/dist/backend/adapters/index.mjs +12 -12
  9. package/dist/backend/adapters/next.js +9189 -8533
  10. package/dist/backend/adapters/next.mjs +9 -9
  11. package/dist/backend/{chunk-KW47VZ73.mjs → chunk-2OI2ZLQY.mjs} +5 -5
  12. package/dist/backend/chunk-2OM5IYSI.mjs +5948 -0
  13. package/dist/backend/{chunk-TEDQUFQV.mjs → chunk-4CBSGNW2.mjs} +1 -1
  14. package/dist/backend/{chunk-WR6ZPCQG.mjs → chunk-GAIH77M4.mjs} +1 -1
  15. package/dist/backend/{chunk-564D2O3W.mjs → chunk-HQKGHTB5.mjs} +1 -1
  16. package/dist/backend/{chunk-SBZEXVB4.mjs → chunk-JGCKPJXX.mjs} +7 -7
  17. package/dist/backend/{chunk-XOAX5KAL.mjs → chunk-K2UF3P2Z.mjs} +1 -1
  18. package/dist/backend/{chunk-RPUV2OZA.mjs → chunk-QEJJM4BY.mjs} +5475 -4998
  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 +9189 -8533
  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 +9189 -8533
  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 +9189 -8533
  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 +9189 -8533
  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 +3641 -3462
  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 +3641 -3462
  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 +9189 -8533
  56. package/dist/backend/index.mjs +10 -10
  57. package/dist/backend/{routeTypes-DnUY8ksp.d.mts → routeTypes-6-0oSlbI.d.mts} +402 -25
  58. package/dist/backend/{routeTypes-TbN5QHEp.d.ts → routeTypes-NNlpTwza.d.ts} +402 -25
  59. package/dist/better-auth/chunk-4E2XIHMW.mjs +6009 -0
  60. package/dist/better-auth/{chunk-SABPXZTZ.mjs → chunk-JB7C63BT.mjs} +5476 -4999
  61. package/dist/better-auth/{chunk-TOQRV6D7.mjs → chunk-KTJ7KXKK.mjs} +1 -1
  62. package/dist/better-auth/index.js +11414 -10758
  63. package/dist/better-auth/index.mjs +3 -3
  64. package/dist/better-auth/utils/createAutumnEndpoint.js +3643 -3464
  65. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  66. package/dist/better-auth/utils/handleBetterAuthRoute.js +9189 -8533
  67. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  68. package/dist/better-auth/utils/index.js +11414 -10758
  69. package/dist/better-auth/utils/index.mjs +3 -3
  70. package/dist/sdk/index.d.mts +553 -37
  71. package/dist/sdk/index.d.ts +553 -37
  72. package/dist/sdk/index.js +7806 -7169
  73. package/dist/sdk/index.mjs +7736 -7155
  74. package/package.json +1 -1
  75. package/dist/backend/chunk-UJS4Q7J4.mjs +0 -5769
  76. package/dist/better-auth/chunk-YRHQ4VL7.mjs +0 -5830
  77. package/dist/backend/{chunk-MOHYGUMA.mjs → chunk-IXUCY7AU.mjs} +3 -3
@@ -1,27 +1,27 @@
1
1
  import "./chunk-WYDGEDEU.mjs";
2
2
  import "./chunk-VXND2UDT.mjs";
3
- import "./chunk-KW47VZ73.mjs";
3
+ import "./chunk-2OI2ZLQY.mjs";
4
4
  import {
5
5
  createCoreHandler
6
- } from "./chunk-SBZEXVB4.mjs";
7
- import "./chunk-RPUV2OZA.mjs";
8
- import "./chunk-MOHYGUMA.mjs";
9
- import "./chunk-TBQ27LIK.mjs";
10
- import "./chunk-J44WR3QZ.mjs";
6
+ } from "./chunk-JGCKPJXX.mjs";
11
7
  import "./chunk-TSF4YCUO.mjs";
12
8
  import {
13
9
  buildRouter
14
10
  } from "./chunk-UAR3TMWI.mjs";
11
+ import "./chunk-QEJJM4BY.mjs";
15
12
  import {
16
13
  routeConfigs
17
- } from "./chunk-UJS4Q7J4.mjs";
14
+ } from "./chunk-2OM5IYSI.mjs";
15
+ import "./chunk-IXUCY7AU.mjs";
18
16
  import "./chunk-OTXV5FY7.mjs";
19
- import {
20
- secretKeyCheck
21
- } from "./chunk-VZIMT7AO.mjs";
22
17
  import {
23
18
  sanitizeBody
24
19
  } from "./chunk-I7CD6EB6.mjs";
20
+ import {
21
+ secretKeyCheck
22
+ } from "./chunk-VZIMT7AO.mjs";
23
+ import "./chunk-TBQ27LIK.mjs";
24
+ import "./chunk-J44WR3QZ.mjs";
25
25
  import {
26
26
  backendError,
27
27
  backendSuccess,
@@ -10012,6 +10012,375 @@ type CreateReferralCodeResponse = {
10012
10012
  createdAt: number;
10013
10013
  };
10014
10014
 
10015
+ /**
10016
+ * When the reward is granted: on redemption, or when the redeemer checks out.
10017
+ */
10018
+ declare const RedeemOnRequest: {
10019
+ readonly CustomerCreation: "customer_creation";
10020
+ readonly Checkout: "checkout";
10021
+ };
10022
+ /**
10023
+ * When the reward is granted: on redemption, or when the redeemer checks out.
10024
+ */
10025
+ type RedeemOnRequest = ClosedEnum<typeof RedeemOnRequest>;
10026
+ /**
10027
+ * Who receives the reward: the referrer only, or both parties.
10028
+ */
10029
+ declare const ReceivedByRequest: {
10030
+ readonly Referrer: "referrer";
10031
+ readonly All: "all";
10032
+ };
10033
+ /**
10034
+ * Who receives the reward: the referrer only, or both parties.
10035
+ */
10036
+ type ReceivedByRequest = ClosedEnum<typeof ReceivedByRequest>;
10037
+ type CreateReferralProgramParams = {
10038
+ id: string;
10039
+ rewardId: string;
10040
+ /**
10041
+ * When the reward is granted: on redemption, or when the redeemer checks out.
10042
+ */
10043
+ redeemOn: RedeemOnRequest;
10044
+ /**
10045
+ * Who receives the reward: the referrer only, or both parties.
10046
+ */
10047
+ receivedBy: ReceivedByRequest;
10048
+ /**
10049
+ * A positive redemption limit, or null for unlimited redemptions.
10050
+ */
10051
+ maxRedemptions?: number | null | undefined;
10052
+ /**
10053
+ * Required when redeem_on is checkout. Plan IDs must be unique.
10054
+ */
10055
+ planIds?: Array<string> | null | undefined;
10056
+ /**
10057
+ * Whether checkouts that start a trial should skip granting the reward.
10058
+ */
10059
+ excludeTrial?: boolean | null | undefined;
10060
+ };
10061
+ /**
10062
+ * When the reward is granted: on redemption, or when the redeemer checks out.
10063
+ */
10064
+ declare const RedeemOnResponse: {
10065
+ readonly CustomerCreation: "customer_creation";
10066
+ readonly Checkout: "checkout";
10067
+ };
10068
+ /**
10069
+ * When the reward is granted: on redemption, or when the redeemer checks out.
10070
+ */
10071
+ type RedeemOnResponse = OpenEnum<typeof RedeemOnResponse>;
10072
+ /**
10073
+ * Who receives the reward: the referrer only, or both parties.
10074
+ */
10075
+ declare const ReceivedByResponse: {
10076
+ readonly Referrer: "referrer";
10077
+ readonly All: "all";
10078
+ };
10079
+ /**
10080
+ * Who receives the reward: the referrer only, or both parties.
10081
+ */
10082
+ type ReceivedByResponse = OpenEnum<typeof ReceivedByResponse>;
10083
+ /**
10084
+ * OK
10085
+ */
10086
+ type CreateReferralProgramResponse = {
10087
+ /**
10088
+ * The unique identifier for the referral program.
10089
+ */
10090
+ id: string;
10091
+ /**
10092
+ * The ID of the reward granted when a code is redeemed.
10093
+ */
10094
+ rewardId: string;
10095
+ /**
10096
+ * When the reward is granted: on redemption, or when the redeemer checks out.
10097
+ */
10098
+ redeemOn: RedeemOnResponse;
10099
+ /**
10100
+ * Who receives the reward: the referrer only, or both parties.
10101
+ */
10102
+ receivedBy: ReceivedByResponse;
10103
+ /**
10104
+ * The maximum number of times a referral code can be redeemed.
10105
+ */
10106
+ maxRedemptions?: number | null | undefined;
10107
+ /**
10108
+ * The plans whose checkout triggers the reward. Only used when redeem_on is checkout.
10109
+ */
10110
+ planIds?: Array<string> | null | undefined;
10111
+ /**
10112
+ * Whether checkouts that start a trial should skip granting the reward.
10113
+ */
10114
+ excludeTrial?: boolean | null | undefined;
10115
+ /**
10116
+ * The Unix timestamp (in milliseconds) when the referral program was created.
10117
+ */
10118
+ createdAt: number;
10119
+ };
10120
+
10121
+ declare const DurationTypeRequestBody: {
10122
+ readonly OneOff: "one_off";
10123
+ readonly Months: "months";
10124
+ readonly Forever: "forever";
10125
+ };
10126
+ type DurationTypeRequestBody = ClosedEnum<typeof DurationTypeRequestBody>;
10127
+ /**
10128
+ * Use a positive integer length for months, and null for one_off or forever.
10129
+ */
10130
+ type CreateRewardDuration = {
10131
+ type: DurationTypeRequestBody;
10132
+ length: number | null;
10133
+ };
10134
+ type CreateRewardCouponPromoCode = {
10135
+ code: string;
10136
+ globalMaxRedemption?: number | null | undefined;
10137
+ firstTimeTransaction?: boolean | null | undefined;
10138
+ };
10139
+ declare const CouponTypeRequestBody: {
10140
+ readonly PercentageDiscount: "percentage_discount";
10141
+ readonly FixedDiscount: "fixed_discount";
10142
+ };
10143
+ type CouponTypeRequestBody = ClosedEnum<typeof CouponTypeRequestBody>;
10144
+ /**
10145
+ * Provide exactly one of coupon or feature_grant, not both.
10146
+ */
10147
+ type CreateRewardCouponRequest = {
10148
+ id: string;
10149
+ name: string;
10150
+ /**
10151
+ * Use a positive integer length for months, and null for one_off or forever.
10152
+ */
10153
+ duration: CreateRewardDuration;
10154
+ /**
10155
+ * Plan IDs must be unique.
10156
+ */
10157
+ planIds: Array<string> | null;
10158
+ /**
10159
+ * Promo code values must be unique.
10160
+ */
10161
+ promoCodes: Array<CreateRewardCouponPromoCode>;
10162
+ type: CouponTypeRequestBody;
10163
+ /**
10164
+ * Percentage discounts must be at most 100; fixed discounts must be positive.
10165
+ */
10166
+ value: number;
10167
+ };
10168
+ /**
10169
+ * The unit of time the grant lasts.
10170
+ */
10171
+ declare const ExpiryTypeRequestBody: {
10172
+ readonly Day: "day";
10173
+ readonly Week: "week";
10174
+ readonly Month: "month";
10175
+ readonly Year: "year";
10176
+ };
10177
+ /**
10178
+ * The unit of time the grant lasts.
10179
+ */
10180
+ type ExpiryTypeRequestBody = ClosedEnum<typeof ExpiryTypeRequestBody>;
10181
+ type ExpiryRequest = {
10182
+ /**
10183
+ * The unit of time the grant lasts.
10184
+ */
10185
+ type: ExpiryTypeRequestBody;
10186
+ /**
10187
+ * The positive integer count of periods before the grant expires.
10188
+ */
10189
+ length: number;
10190
+ };
10191
+ type CreateRewardGrant = {
10192
+ featureId: string;
10193
+ /**
10194
+ * A positive amount to grant, or null for boolean features.
10195
+ */
10196
+ included: number | null;
10197
+ expiry: ExpiryRequest | null;
10198
+ };
10199
+ type CreateRewardFeatureGrantPromoCode = {
10200
+ code: string;
10201
+ /**
10202
+ * A positive redemption limit, or null for unlimited uses.
10203
+ */
10204
+ maxUses: number | null;
10205
+ };
10206
+ /**
10207
+ * Provide exactly one of coupon or feature_grant, not both.
10208
+ */
10209
+ type CreateRewardFeatureGrantRequest = {
10210
+ id: string;
10211
+ name: string;
10212
+ /**
10213
+ * Feature IDs must be unique.
10214
+ */
10215
+ grants: Array<CreateRewardGrant>;
10216
+ /**
10217
+ * Promo code values must be unique.
10218
+ */
10219
+ promoCodes: Array<CreateRewardFeatureGrantPromoCode>;
10220
+ };
10221
+ type CreateRewardParams = {
10222
+ /**
10223
+ * Provide exactly one of coupon or feature_grant, not both.
10224
+ */
10225
+ coupon?: CreateRewardCouponRequest | undefined;
10226
+ /**
10227
+ * Provide exactly one of coupon or feature_grant, not both.
10228
+ */
10229
+ featureGrant?: CreateRewardFeatureGrantRequest | undefined;
10230
+ };
10231
+ /**
10232
+ * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
10233
+ */
10234
+ declare const CreateRewardCouponTypeResponse: {
10235
+ readonly PercentageDiscount: "percentage_discount";
10236
+ readonly FixedDiscount: "fixed_discount";
10237
+ readonly InvoiceCredits: "invoice_credits";
10238
+ };
10239
+ /**
10240
+ * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
10241
+ */
10242
+ type CreateRewardCouponTypeResponse = OpenEnum<typeof CreateRewardCouponTypeResponse>;
10243
+ /**
10244
+ * The unit of time the duration is measured in.
10245
+ */
10246
+ declare const CreateRewardDurationTypeResponse: {
10247
+ readonly OneOff: "one_off";
10248
+ readonly Months: "months";
10249
+ readonly Forever: "forever";
10250
+ };
10251
+ /**
10252
+ * The unit of time the duration is measured in.
10253
+ */
10254
+ type CreateRewardDurationTypeResponse = OpenEnum<typeof CreateRewardDurationTypeResponse>;
10255
+ /**
10256
+ * How long the coupon applies once redeemed.
10257
+ */
10258
+ type CreateRewardDurationResponse = {
10259
+ /**
10260
+ * The unit of time the duration is measured in.
10261
+ */
10262
+ type: CreateRewardDurationTypeResponse;
10263
+ /**
10264
+ * The number of `type` periods the duration lasts, or null when the type has no length (e.g. one_off, forever).
10265
+ */
10266
+ length: number | null;
10267
+ };
10268
+ type CreateRewardCouponPromoCodeResponse = {
10269
+ /**
10270
+ * The promo code customers enter to redeem the coupon.
10271
+ */
10272
+ code: string;
10273
+ /**
10274
+ * Maximum number of times this promo code can be redeemed across all customers, or null for unlimited.
10275
+ */
10276
+ globalMaxRedemption?: number | null | undefined;
10277
+ /**
10278
+ * Whether this promo code can only be applied to a customer's first transaction.
10279
+ */
10280
+ firstTimeTransaction?: boolean | null | undefined;
10281
+ };
10282
+ type CreateRewardCouponResponse = {
10283
+ /**
10284
+ * The unique identifier for the coupon.
10285
+ */
10286
+ id: string;
10287
+ /**
10288
+ * A human-readable name for the coupon.
10289
+ */
10290
+ name?: string | null | undefined;
10291
+ /**
10292
+ * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
10293
+ */
10294
+ type: CreateRewardCouponTypeResponse;
10295
+ /**
10296
+ * The discount value. A percentage for percentage_discount, or an amount for fixed_discount / invoice_credits.
10297
+ */
10298
+ value: number;
10299
+ /**
10300
+ * How long the coupon applies once redeemed.
10301
+ */
10302
+ duration: CreateRewardDurationResponse;
10303
+ /**
10304
+ * The plan IDs the coupon applies to, or null when it applies to all plans.
10305
+ */
10306
+ planIds: Array<string> | null;
10307
+ promoCodes: Array<CreateRewardCouponPromoCodeResponse>;
10308
+ /**
10309
+ * The Unix timestamp (in milliseconds) when the coupon was created.
10310
+ */
10311
+ createdAt: number;
10312
+ };
10313
+ /**
10314
+ * The unit of time the grant lasts.
10315
+ */
10316
+ declare const CreateRewardExpiryTypeResponse: {
10317
+ readonly Day: "day";
10318
+ readonly Week: "week";
10319
+ readonly Month: "month";
10320
+ readonly Year: "year";
10321
+ };
10322
+ /**
10323
+ * The unit of time the grant lasts.
10324
+ */
10325
+ type CreateRewardExpiryTypeResponse = OpenEnum<typeof CreateRewardExpiryTypeResponse>;
10326
+ type CreateRewardExpiryResponse = {
10327
+ /**
10328
+ * The unit of time the grant lasts.
10329
+ */
10330
+ type: CreateRewardExpiryTypeResponse;
10331
+ /**
10332
+ * The positive integer count of periods before the grant expires.
10333
+ */
10334
+ length: number;
10335
+ };
10336
+ type CreateRewardGrantResponse = {
10337
+ /**
10338
+ * The feature ID this grant applies to.
10339
+ */
10340
+ featureId: string;
10341
+ /**
10342
+ * The amount of the feature granted, or null for boolean features.
10343
+ */
10344
+ included: number | null;
10345
+ /**
10346
+ * How long the granted amount lasts before expiring, or null for a permanent grant.
10347
+ */
10348
+ expiry: CreateRewardExpiryResponse | null;
10349
+ };
10350
+ type CreateRewardFeatureGrantPromoCodeResponse = {
10351
+ /**
10352
+ * The promo code customers enter to redeem the feature grant.
10353
+ */
10354
+ code: string;
10355
+ /**
10356
+ * Maximum number of times this promo code can be redeemed, or null for unlimited.
10357
+ */
10358
+ maxUses: number | null;
10359
+ };
10360
+ type CreateRewardFeatureGrantResponse = {
10361
+ /**
10362
+ * The unique identifier for the feature grant.
10363
+ */
10364
+ id: string;
10365
+ /**
10366
+ * A human-readable name for the feature grant.
10367
+ */
10368
+ name?: string | null | undefined;
10369
+ grants: Array<CreateRewardGrantResponse>;
10370
+ promoCodes: Array<CreateRewardFeatureGrantPromoCodeResponse>;
10371
+ /**
10372
+ * The Unix timestamp (in milliseconds) when the feature grant was created.
10373
+ */
10374
+ createdAt: number;
10375
+ };
10376
+ /**
10377
+ * OK
10378
+ */
10379
+ type CreateRewardResponse = {
10380
+ coupon?: CreateRewardCouponResponse | undefined;
10381
+ featureGrant?: CreateRewardFeatureGrantResponse | undefined;
10382
+ };
10383
+
10015
10384
  /**
10016
10385
  * Unit of time for the trial ('day', 'month', 'year').
10017
10386
  */
@@ -10994,7 +11363,7 @@ type CreateScheduleParams = {
10994
11363
  */
10995
11364
  freeTrial?: CreateScheduleFreeTrialParams | null | undefined;
10996
11365
  /**
10997
- * Currency used to bill the immediate phase.
11366
+ * Three-letter Stripe-supported currency code used to bill the immediate phase (for example, 'usd').
10998
11367
  */
10999
11368
  currency?: string | undefined;
11000
11369
  /**
@@ -18800,7 +19169,7 @@ type RewardsListParams = {};
18800
19169
  /**
18801
19170
  * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
18802
19171
  */
18803
- declare const CouponType: {
19172
+ declare const ListRewardsCouponType: {
18804
19173
  readonly PercentageDiscount: "percentage_discount";
18805
19174
  readonly FixedDiscount: "fixed_discount";
18806
19175
  readonly InvoiceCredits: "invoice_credits";
@@ -18808,11 +19177,11 @@ declare const CouponType: {
18808
19177
  /**
18809
19178
  * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
18810
19179
  */
18811
- type CouponType = OpenEnum<typeof CouponType>;
19180
+ type ListRewardsCouponType = OpenEnum<typeof ListRewardsCouponType>;
18812
19181
  /**
18813
19182
  * The unit of time the duration is measured in.
18814
19183
  */
18815
- declare const DurationType: {
19184
+ declare const ListRewardsDurationType: {
18816
19185
  readonly OneOff: "one_off";
18817
19186
  readonly Months: "months";
18818
19187
  readonly Forever: "forever";
@@ -18820,7 +19189,7 @@ declare const DurationType: {
18820
19189
  /**
18821
19190
  * The unit of time the duration is measured in.
18822
19191
  */
18823
- type DurationType = OpenEnum<typeof DurationType>;
19192
+ type ListRewardsDurationType = OpenEnum<typeof ListRewardsDurationType>;
18824
19193
  /**
18825
19194
  * How long the coupon applies once redeemed.
18826
19195
  */
@@ -18828,13 +19197,13 @@ type ListRewardsDuration = {
18828
19197
  /**
18829
19198
  * The unit of time the duration is measured in.
18830
19199
  */
18831
- type: DurationType;
19200
+ type: ListRewardsDurationType;
18832
19201
  /**
18833
19202
  * The number of `type` periods the duration lasts, or null when the type has no length (e.g. one_off, forever).
18834
19203
  */
18835
19204
  length: number | null;
18836
19205
  };
18837
- type CouponPromoCode = {
19206
+ type ListRewardsCouponPromoCode = {
18838
19207
  /**
18839
19208
  * The promo code customers enter to redeem the coupon.
18840
19209
  */
@@ -18860,7 +19229,7 @@ type Coupon = {
18860
19229
  /**
18861
19230
  * The type of discount: percentage_discount, fixed_discount, or invoice_credits.
18862
19231
  */
18863
- type: CouponType;
19232
+ type: ListRewardsCouponType;
18864
19233
  /**
18865
19234
  * The discount value. A percentage for percentage_discount, or an amount for fixed_discount / invoice_credits.
18866
19235
  */
@@ -18876,36 +19245,36 @@ type Coupon = {
18876
19245
  /**
18877
19246
  * The promo codes customers can use to redeem the coupon.
18878
19247
  */
18879
- promoCodes: Array<CouponPromoCode>;
19248
+ promoCodes: Array<ListRewardsCouponPromoCode>;
18880
19249
  /**
18881
19250
  * The Unix timestamp (in milliseconds) when the coupon was created.
18882
19251
  */
18883
19252
  createdAt: number;
18884
19253
  };
18885
19254
  /**
18886
- * The unit of time the duration is measured in.
19255
+ * The unit of time the grant lasts.
18887
19256
  */
18888
- declare const ExpiryType: {
19257
+ declare const ListRewardsExpiryType: {
18889
19258
  readonly Day: "day";
18890
19259
  readonly Week: "week";
18891
19260
  readonly Month: "month";
18892
19261
  readonly Year: "year";
18893
19262
  };
18894
19263
  /**
18895
- * The unit of time the duration is measured in.
19264
+ * The unit of time the grant lasts.
18896
19265
  */
18897
- type ExpiryType = OpenEnum<typeof ExpiryType>;
18898
- type Expiry = {
19266
+ type ListRewardsExpiryType = OpenEnum<typeof ListRewardsExpiryType>;
19267
+ type ListRewardsExpiry = {
18899
19268
  /**
18900
- * The unit of time the duration is measured in.
19269
+ * The unit of time the grant lasts.
18901
19270
  */
18902
- type: ExpiryType;
19271
+ type: ListRewardsExpiryType;
18903
19272
  /**
18904
- * The number of `type` periods the duration lasts, or null when the type has no length (e.g. one_off, forever).
19273
+ * The positive integer count of periods before the grant expires.
18905
19274
  */
18906
- length: number | null;
19275
+ length: number;
18907
19276
  };
18908
- type Grant = {
19277
+ type ListRewardsGrant = {
18909
19278
  /**
18910
19279
  * The feature ID this grant applies to.
18911
19280
  */
@@ -18917,9 +19286,9 @@ type Grant = {
18917
19286
  /**
18918
19287
  * How long the granted amount lasts before expiring, or null for a permanent grant.
18919
19288
  */
18920
- expiry: Expiry | null;
19289
+ expiry: ListRewardsExpiry | null;
18921
19290
  };
18922
- type FeatureGrantPromoCode = {
19291
+ type ListRewardsFeatureGrantPromoCode = {
18923
19292
  /**
18924
19293
  * The promo code customers enter to redeem the feature grant.
18925
19294
  */
@@ -18941,11 +19310,11 @@ type FeatureGrant = {
18941
19310
  /**
18942
19311
  * The feature grants awarded when the grant is redeemed.
18943
19312
  */
18944
- grants: Array<Grant>;
19313
+ grants: Array<ListRewardsGrant>;
18945
19314
  /**
18946
19315
  * The promo codes customers can use to redeem the feature grant.
18947
19316
  */
18948
- promoCodes: Array<FeatureGrantPromoCode>;
19317
+ promoCodes: Array<ListRewardsFeatureGrantPromoCode>;
18949
19318
  /**
18950
19319
  * The Unix timestamp (in milliseconds) when the feature grant was created.
18951
19320
  */
@@ -32075,13 +32444,13 @@ declare class Billing extends ClientSDK {
32075
32444
  * @example
32076
32445
  * ```typescript
32077
32446
  * // Schedule a transition from a trial plan to a paid plan
32078
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785760797907,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786970397907,"plans":[{"planId":"pro_plan"}]}] });
32447
+ * 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"}]}] });
32079
32448
  * ```
32080
32449
  *
32081
32450
  * @param customerId - The ID of the customer to create the schedule for.
32082
32451
  * @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
32083
32452
  * @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
32084
- * @param currency - Currency used to bill the immediate phase. (optional)
32453
+ * @param currency - Three-letter Stripe-supported currency code used to bill the immediate phase (for example, 'usd'). (optional)
32085
32454
  * @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
32086
32455
  * @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)
32087
32456
  * @param successUrl - URL to redirect to after successful checkout. (optional)
@@ -32919,9 +33288,17 @@ declare class Referrals extends ClientSDK {
32919
33288
  * Redeem a referral code for a customer.
32920
33289
  */
32921
33290
  redeemCode(request: RedeemReferralCodeParams, options?: RequestOptions): Promise<RedeemReferralCodeResponse>;
33291
+ /**
33292
+ * Create a referral program linked to an existing reward.
33293
+ */
33294
+ createProgram(request: CreateReferralProgramParams, options?: RequestOptions): Promise<CreateReferralProgramResponse>;
32922
33295
  }
32923
33296
 
32924
33297
  declare class Rewards extends ClientSDK {
33298
+ /**
33299
+ * Create a coupon or feature grant.
33300
+ */
33301
+ create(request: CreateRewardParams, options?: RequestOptions): Promise<CreateRewardResponse>;
32925
33302
  /**
32926
33303
  * List the coupons and feature grants configured for the org.
32927
33304
  */