autumn-js 1.3.19 → 1.3.21

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 (102) hide show
  1. package/dist/backend/adapters/express.js +80 -12
  2. package/dist/backend/adapters/express.mjs +5 -5
  3. package/dist/backend/adapters/fetch.js +80 -12
  4. package/dist/backend/adapters/fetch.mjs +5 -5
  5. package/dist/backend/adapters/hono.js +80 -12
  6. package/dist/backend/adapters/hono.mjs +5 -5
  7. package/dist/backend/adapters/index.js +80 -12
  8. package/dist/backend/adapters/index.mjs +8 -8
  9. package/dist/backend/adapters/next.js +80 -12
  10. package/dist/backend/adapters/next.mjs +5 -5
  11. package/dist/backend/{chunk-RGGW7MYQ.mjs → chunk-5MHFZETT.mjs} +50 -6
  12. package/dist/backend/{chunk-R6CWGJRR.mjs → chunk-7HAJHIDK.mjs} +2 -2
  13. package/dist/backend/{chunk-EETAZF3L.mjs → chunk-AZAFGMQX.mjs} +1 -1
  14. package/dist/backend/{chunk-NX3QPLEZ.mjs → chunk-CCYZDY2S.mjs} +1 -1
  15. package/dist/backend/{chunk-ET3EY5PE.mjs → chunk-IU4DGONB.mjs} +30 -6
  16. package/dist/backend/{chunk-ORQUSNYD.mjs → chunk-NCQMQWZZ.mjs} +1 -1
  17. package/dist/backend/{chunk-KPND33EK.mjs → chunk-UUXEUVUW.mjs} +2 -2
  18. package/dist/backend/{chunk-F6RWEUFE.mjs → chunk-ZL7TQVBF.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 +80 -12
  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 +80 -12
  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 +80 -12
  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 +80 -12
  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 +30 -6
  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 +30 -6
  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 +80 -12
  54. package/dist/backend/index.mjs +4 -4
  55. package/dist/backend/{routeTypes-CVNEIkWv.d.mts → routeTypes-BDhI1aVG.d.mts} +41 -0
  56. package/dist/backend/{routeTypes-DRaLLtYM.d.ts → routeTypes-S7the8kq.d.ts} +41 -0
  57. package/dist/better-auth/{chunk-24CG3YJD.mjs → chunk-I5EKFT6Q.mjs} +1 -1
  58. package/dist/better-auth/{chunk-LCFFOKLD.mjs → chunk-IZPM54OK.mjs} +30 -6
  59. package/dist/better-auth/{chunk-EU45GEWM.mjs → chunk-YTTMRMTV.mjs} +51 -7
  60. package/dist/better-auth/index.js +80 -12
  61. package/dist/better-auth/index.mjs +3 -3
  62. package/dist/better-auth/utils/createAutumnEndpoint.js +30 -6
  63. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  64. package/dist/better-auth/utils/handleBetterAuthRoute.js +80 -12
  65. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  66. package/dist/better-auth/utils/index.js +80 -12
  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/client/AutumnClient.d.mts +1 -1
  71. package/dist/react/client/AutumnClient.d.ts +1 -1
  72. package/dist/react/client/IAutumnClient.d.mts +1 -1
  73. package/dist/react/client/IAutumnClient.d.ts +1 -1
  74. package/dist/react/client/index.d.mts +1 -1
  75. package/dist/react/client/index.d.ts +1 -1
  76. package/dist/react/hooks/index.d.mts +1 -1
  77. package/dist/react/hooks/index.d.ts +1 -1
  78. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
  79. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
  80. package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
  81. package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
  82. package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
  83. package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
  84. package/dist/react/hooks/useCustomer.d.mts +1 -1
  85. package/dist/react/hooks/useCustomer.d.ts +1 -1
  86. package/dist/react/hooks/useEntity.d.mts +1 -1
  87. package/dist/react/hooks/useEntity.d.ts +1 -1
  88. package/dist/react/hooks/useListEvents.d.mts +1 -1
  89. package/dist/react/hooks/useListEvents.d.ts +1 -1
  90. package/dist/react/hooks/useListPlans.d.mts +1 -1
  91. package/dist/react/hooks/useListPlans.d.ts +1 -1
  92. package/dist/react/hooks/useReferrals.d.mts +1 -1
  93. package/dist/react/hooks/useReferrals.d.ts +1 -1
  94. package/dist/react/index.d.mts +1 -1
  95. package/dist/react/index.d.ts +1 -1
  96. package/dist/react/{params-BNmjxPTb.d.mts → params-B1GU-u8Q.d.mts} +39 -0
  97. package/dist/react/{params-DOhtJtIQ.d.ts → params-Dp-az5AD.d.ts} +39 -0
  98. package/dist/sdk/index.d.mts +66 -1
  99. package/dist/sdk/index.d.ts +66 -1
  100. package/dist/sdk/index.js +73 -6
  101. package/dist/sdk/index.mjs +68 -7
  102. package/package.json +2 -2
@@ -3472,6 +3472,16 @@ var AttachLicenseQuantity$outboundSchema = z13.pipe(
3472
3472
  });
3473
3473
  })
3474
3474
  );
3475
+ var AttachRemoveDiscount$outboundSchema = z13.pipe(
3476
+ z13.object({
3477
+ rewardId: z13.string()
3478
+ }),
3479
+ z13.transform((v) => {
3480
+ return remap(v, {
3481
+ rewardId: "reward_id"
3482
+ });
3483
+ })
3484
+ );
3475
3485
  var AttachParams$outboundSchema = z13.pipe(
3476
3486
  z13.object({
3477
3487
  customerId: z13.string(),
@@ -3516,7 +3526,10 @@ var AttachParams$outboundSchema = z13.pipe(
3516
3526
  enablePlanImmediately: z13.optional(z13.boolean()),
3517
3527
  taxRateId: z13.optional(z13.string()),
3518
3528
  currency: z13.optional(z13.string()),
3519
- removePlanIds: z13.optional(z13.array(z13.string()))
3529
+ removePlanIds: z13.optional(z13.array(z13.string())),
3530
+ removeDiscounts: z13.optional(
3531
+ z13.array(z13.lazy(() => AttachRemoveDiscount$outboundSchema))
3532
+ )
3520
3533
  }),
3521
3534
  z13.transform((v) => {
3522
3535
  return remap(v, {
@@ -3545,7 +3558,8 @@ var AttachParams$outboundSchema = z13.pipe(
3545
3558
  noBillingChanges: "no_billing_changes",
3546
3559
  enablePlanImmediately: "enable_plan_immediately",
3547
3560
  taxRateId: "tax_rate_id",
3548
- removePlanIds: "remove_plan_ids"
3561
+ removePlanIds: "remove_plan_ids",
3562
+ removeDiscounts: "remove_discounts"
3549
3563
  });
3550
3564
  })
3551
3565
  );
@@ -37058,6 +37072,16 @@ var PreviewAttachLicenseQuantity$outboundSchema = z80.pipe(
37058
37072
  });
37059
37073
  })
37060
37074
  );
37075
+ var PreviewAttachRemoveDiscount$outboundSchema = z80.pipe(
37076
+ z80.object({
37077
+ rewardId: z80.string()
37078
+ }),
37079
+ z80.transform((v) => {
37080
+ return remap(v, {
37081
+ rewardId: "reward_id"
37082
+ });
37083
+ })
37084
+ );
37061
37085
  var PreviewAttachParams$outboundSchema = z80.pipe(
37062
37086
  z80.object({
37063
37087
  customerId: z80.string(),
@@ -37111,7 +37135,10 @@ var PreviewAttachParams$outboundSchema = z80.pipe(
37111
37135
  enablePlanImmediately: z80.optional(z80.boolean()),
37112
37136
  taxRateId: z80.optional(z80.string()),
37113
37137
  currency: z80.optional(z80.string()),
37114
- removePlanIds: z80.optional(z80.array(z80.string()))
37138
+ removePlanIds: z80.optional(z80.array(z80.string())),
37139
+ removeDiscounts: z80.optional(
37140
+ z80.array(z80.lazy(() => PreviewAttachRemoveDiscount$outboundSchema))
37141
+ )
37115
37142
  }),
37116
37143
  z80.transform((v) => {
37117
37144
  return remap(v, {
@@ -37140,7 +37167,8 @@ var PreviewAttachParams$outboundSchema = z80.pipe(
37140
37167
  noBillingChanges: "no_billing_changes",
37141
37168
  enablePlanImmediately: "enable_plan_immediately",
37142
37169
  taxRateId: "tax_rate_id",
37143
- removePlanIds: "remove_plan_ids"
37170
+ removePlanIds: "remove_plan_ids",
37171
+ removeDiscounts: "remove_discounts"
37144
37172
  });
37145
37173
  })
37146
37174
  );
@@ -44063,6 +44091,16 @@ var SetupPaymentLicenseQuantity$outboundSchema = z94.pipe(
44063
44091
  });
44064
44092
  })
44065
44093
  );
44094
+ var SetupPaymentRemoveDiscount$outboundSchema = z94.pipe(
44095
+ z94.object({
44096
+ rewardId: z94.string()
44097
+ }),
44098
+ z94.transform((v) => {
44099
+ return remap(v, {
44100
+ rewardId: "reward_id"
44101
+ });
44102
+ })
44103
+ );
44066
44104
  var SetupPaymentParams$outboundSchema = z94.pipe(
44067
44105
  z94.object({
44068
44106
  customerId: z94.string(),
@@ -44104,7 +44142,10 @@ var SetupPaymentParams$outboundSchema = z94.pipe(
44104
44142
  enablePlanImmediately: z94.optional(z94.boolean()),
44105
44143
  taxRateId: z94.optional(z94.string()),
44106
44144
  currency: z94.optional(z94.string()),
44107
- removePlanIds: z94.optional(z94.array(z94.string()))
44145
+ removePlanIds: z94.optional(z94.array(z94.string())),
44146
+ removeDiscounts: z94.optional(
44147
+ z94.array(z94.lazy(() => SetupPaymentRemoveDiscount$outboundSchema))
44148
+ )
44108
44149
  }),
44109
44150
  z94.transform((v) => {
44110
44151
  return remap(v, {
@@ -44128,7 +44169,8 @@ var SetupPaymentParams$outboundSchema = z94.pipe(
44128
44169
  noBillingChanges: "no_billing_changes",
44129
44170
  enablePlanImmediately: "enable_plan_immediately",
44130
44171
  taxRateId: "tax_rate_id",
44131
- removePlanIds: "remove_plan_ids"
44172
+ removePlanIds: "remove_plan_ids",
44173
+ removeDiscounts: "remove_discounts"
44132
44174
  });
44133
44175
  })
44134
44176
  );
@@ -55013,6 +55055,7 @@ var Billing = class extends ClientSDK {
55013
55055
  * @param taxRateId - Stripe tax rate ID (txr_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items. (optional)
55014
55056
  * @param currency - Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
55015
55057
  * @param removePlanIds - Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected. (optional)
55058
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
55016
55059
  *
55017
55060
  * @returns A billing response with customer ID, invoice details, and payment URL (if checkout required).
55018
55061
  */
@@ -55150,6 +55193,7 @@ var Billing = class extends ClientSDK {
55150
55193
  * @param taxRateId - Stripe tax rate ID (txr_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items. (optional)
55151
55194
  * @param currency - Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
55152
55195
  * @param removePlanIds - Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected. (optional)
55196
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
55153
55197
  *
55154
55198
  * @returns A preview response with line items, totals, and effective dates for the proposed changes.
55155
55199
  */
@@ -61295,6 +61339,9 @@ var attachLicenseQuantitySchema = import_v42.z.object({
61295
61339
  licensePlanId: import_v42.z.string(),
61296
61340
  quantity: import_v42.z.number()
61297
61341
  });
61342
+ var attachRemoveDiscountSchema = import_v42.z.object({
61343
+ rewardId: import_v42.z.string()
61344
+ });
61298
61345
  var attachInvoiceSchema = import_v42.z.object({
61299
61346
  status: import_v42.z.string().nullable(),
61300
61347
  stripeId: import_v42.z.string(),
@@ -61519,6 +61566,9 @@ var attachLicenseQuantityOutboundSchema = import_v42.z.object({
61519
61566
  license_plan_id: import_v42.z.string(),
61520
61567
  quantity: import_v42.z.number()
61521
61568
  });
61569
+ var attachRemoveDiscountOutboundSchema = import_v42.z.object({
61570
+ reward_id: import_v42.z.string()
61571
+ });
61522
61572
  var closedEnumSchema2 = import_v42.z.any();
61523
61573
  var attachUpsertLicenseThresholdBillingSchema = import_v42.z.any();
61524
61574
  var attachUpsertLicenseResetSchema = import_v42.z.any();
@@ -61744,7 +61794,8 @@ var attachParamsSchema = import_v42.z.object({
61744
61794
  enablePlanImmediately: import_v42.z.union([import_v42.z.boolean(), import_v42.z.undefined()]).optional(),
61745
61795
  taxRateId: import_v42.z.union([import_v42.z.string(), import_v42.z.undefined()]).optional(),
61746
61796
  currency: import_v42.z.union([import_v42.z.string(), import_v42.z.undefined()]).optional(),
61747
- removePlanIds: import_v42.z.union([import_v42.z.array(import_v42.z.string()), import_v42.z.undefined()]).optional()
61797
+ removePlanIds: import_v42.z.union([import_v42.z.array(import_v42.z.string()), import_v42.z.undefined()]).optional(),
61798
+ removeDiscounts: import_v42.z.union([import_v42.z.array(attachRemoveDiscountSchema), import_v42.z.undefined()]).optional()
61748
61799
  });
61749
61800
  var attachCodeSchema = openEnumSchema2;
61750
61801
  var attachRequiredActionSchema = import_v42.z.object({
@@ -61828,7 +61879,8 @@ var attachParamsOutboundSchema = import_v42.z.object({
61828
61879
  enable_plan_immediately: import_v42.z.union([import_v42.z.boolean(), import_v42.z.undefined()]).optional(),
61829
61880
  tax_rate_id: import_v42.z.union([import_v42.z.string(), import_v42.z.undefined()]).optional(),
61830
61881
  currency: import_v42.z.union([import_v42.z.string(), import_v42.z.undefined()]).optional(),
61831
- remove_plan_ids: import_v42.z.union([import_v42.z.array(import_v42.z.string()), import_v42.z.undefined()]).optional()
61882
+ remove_plan_ids: import_v42.z.union([import_v42.z.array(import_v42.z.string()), import_v42.z.undefined()]).optional(),
61883
+ remove_discounts: import_v42.z.union([import_v42.z.array(attachRemoveDiscountOutboundSchema), import_v42.z.undefined()]).optional()
61832
61884
  });
61833
61885
 
61834
61886
  // src/generated/createReferralCodeSchemas.ts
@@ -64095,6 +64147,9 @@ var previewAttachLicenseQuantitySchema = import_v412.z.object({
64095
64147
  licensePlanId: import_v412.z.string(),
64096
64148
  quantity: import_v412.z.number()
64097
64149
  });
64150
+ var previewAttachRemoveDiscountSchema = import_v412.z.object({
64151
+ rewardId: import_v412.z.string()
64152
+ });
64098
64153
  var previewAttachDiscountSchema = import_v412.z.object({
64099
64154
  amountOff: import_v412.z.number(),
64100
64155
  percentOff: import_v412.z.union([import_v412.z.number(), import_v412.z.undefined()]).optional(),
@@ -64383,6 +64438,9 @@ var previewAttachLicenseQuantityOutboundSchema = import_v412.z.object({
64383
64438
  license_plan_id: import_v412.z.string(),
64384
64439
  quantity: import_v412.z.number()
64385
64440
  });
64441
+ var previewAttachRemoveDiscountOutboundSchema = import_v412.z.object({
64442
+ reward_id: import_v412.z.string()
64443
+ });
64386
64444
  var closedEnumSchema8 = import_v412.z.any();
64387
64445
  var previewAttachUpsertLicenseThresholdBillingSchema = import_v412.z.any();
64388
64446
  var previewAttachUpsertLicenseResetSchema = import_v412.z.any();
@@ -64618,7 +64676,8 @@ var previewAttachParamsSchema = import_v412.z.object({
64618
64676
  enablePlanImmediately: import_v412.z.union([import_v412.z.boolean(), import_v412.z.undefined()]).optional(),
64619
64677
  taxRateId: import_v412.z.union([import_v412.z.string(), import_v412.z.undefined()]).optional(),
64620
64678
  currency: import_v412.z.union([import_v412.z.string(), import_v412.z.undefined()]).optional(),
64621
- removePlanIds: import_v412.z.union([import_v412.z.array(import_v412.z.string()), import_v412.z.undefined()]).optional()
64679
+ removePlanIds: import_v412.z.union([import_v412.z.array(import_v412.z.string()), import_v412.z.undefined()]).optional(),
64680
+ removeDiscounts: import_v412.z.union([import_v412.z.array(previewAttachRemoveDiscountSchema), import_v412.z.undefined()]).optional()
64622
64681
  });
64623
64682
  var previewAttachIncomingSchema = import_v412.z.object({
64624
64683
  planId: import_v412.z.string(),
@@ -64743,7 +64802,8 @@ var previewAttachParamsOutboundSchema = import_v412.z.object({
64743
64802
  enable_plan_immediately: import_v412.z.union([import_v412.z.boolean(), import_v412.z.undefined()]).optional(),
64744
64803
  tax_rate_id: import_v412.z.union([import_v412.z.string(), import_v412.z.undefined()]).optional(),
64745
64804
  currency: import_v412.z.union([import_v412.z.string(), import_v412.z.undefined()]).optional(),
64746
- remove_plan_ids: import_v412.z.union([import_v412.z.array(import_v412.z.string()), import_v412.z.undefined()]).optional()
64805
+ remove_plan_ids: import_v412.z.union([import_v412.z.array(import_v412.z.string()), import_v412.z.undefined()]).optional(),
64806
+ remove_discounts: import_v412.z.union([import_v412.z.array(previewAttachRemoveDiscountOutboundSchema), import_v412.z.undefined()]).optional()
64747
64807
  });
64748
64808
 
64749
64809
  // src/generated/previewMultiAttachSchemas.ts
@@ -66489,6 +66549,9 @@ var setupPaymentLicenseQuantitySchema = import_v416.z.object({
66489
66549
  licensePlanId: import_v416.z.string(),
66490
66550
  quantity: import_v416.z.number()
66491
66551
  });
66552
+ var setupPaymentRemoveDiscountSchema = import_v416.z.object({
66553
+ rewardId: import_v416.z.string()
66554
+ });
66492
66555
  var setupPaymentResponseSchema = import_v416.z.object({
66493
66556
  customerId: import_v416.z.string(),
66494
66557
  entityId: import_v416.z.union([import_v416.z.string(), import_v416.z.undefined()]).optional(),
@@ -66696,6 +66759,9 @@ var setupPaymentLicenseQuantityOutboundSchema = import_v416.z.object({
66696
66759
  license_plan_id: import_v416.z.string(),
66697
66760
  quantity: import_v416.z.number()
66698
66761
  });
66762
+ var setupPaymentRemoveDiscountOutboundSchema = import_v416.z.object({
66763
+ reward_id: import_v416.z.string()
66764
+ });
66699
66765
  var closedEnumSchema11 = import_v416.z.any();
66700
66766
  var setupPaymentUpsertLicenseThresholdBillingSchema = import_v416.z.any();
66701
66767
  var setupPaymentUpsertLicenseResetSchema = import_v416.z.any();
@@ -66919,7 +66985,8 @@ var setupPaymentParamsSchema = import_v416.z.object({
66919
66985
  enablePlanImmediately: import_v416.z.union([import_v416.z.boolean(), import_v416.z.undefined()]).optional(),
66920
66986
  taxRateId: import_v416.z.union([import_v416.z.string(), import_v416.z.undefined()]).optional(),
66921
66987
  currency: import_v416.z.union([import_v416.z.string(), import_v416.z.undefined()]).optional(),
66922
- removePlanIds: import_v416.z.union([import_v416.z.array(import_v416.z.string()), import_v416.z.undefined()]).optional()
66988
+ removePlanIds: import_v416.z.union([import_v416.z.array(import_v416.z.string()), import_v416.z.undefined()]).optional(),
66989
+ removeDiscounts: import_v416.z.union([import_v416.z.array(setupPaymentRemoveDiscountSchema), import_v416.z.undefined()]).optional()
66923
66990
  });
66924
66991
  var setupPaymentUpsertLicensePlanItemOutboundSchema = import_v416.z.object({
66925
66992
  threshold_billing: import_v416.z.union([
@@ -66995,7 +67062,8 @@ var setupPaymentParamsOutboundSchema = import_v416.z.object({
66995
67062
  enable_plan_immediately: import_v416.z.union([import_v416.z.boolean(), import_v416.z.undefined()]).optional(),
66996
67063
  tax_rate_id: import_v416.z.union([import_v416.z.string(), import_v416.z.undefined()]).optional(),
66997
67064
  currency: import_v416.z.union([import_v416.z.string(), import_v416.z.undefined()]).optional(),
66998
- remove_plan_ids: import_v416.z.union([import_v416.z.array(import_v416.z.string()), import_v416.z.undefined()]).optional()
67065
+ remove_plan_ids: import_v416.z.union([import_v416.z.array(import_v416.z.string()), import_v416.z.undefined()]).optional(),
67066
+ remove_discounts: import_v416.z.union([import_v416.z.array(setupPaymentRemoveDiscountOutboundSchema), import_v416.z.undefined()]).optional()
66999
67067
  });
67000
67068
 
67001
67069
  // src/generated/updateSubscriptionSchemas.ts
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  autumnHandler
3
- } from "../chunk-NX3QPLEZ.mjs";
3
+ } from "../chunk-CCYZDY2S.mjs";
4
4
  import "../chunk-WYDGEDEU.mjs";
5
5
  import "../chunk-VXND2UDT.mjs";
6
- import "../chunk-R6CWGJRR.mjs";
7
- import "../chunk-KPND33EK.mjs";
8
- import "../chunk-RGGW7MYQ.mjs";
6
+ import "../chunk-7HAJHIDK.mjs";
7
+ import "../chunk-UUXEUVUW.mjs";
8
+ import "../chunk-5MHFZETT.mjs";
9
9
  import "../chunk-MOHYGUMA.mjs";
10
10
  import "../chunk-TBQ27LIK.mjs";
11
11
  import "../chunk-J44WR3QZ.mjs";
12
12
  import "../chunk-TSF4YCUO.mjs";
13
13
  import "../chunk-UAR3TMWI.mjs";
14
- import "../chunk-ET3EY5PE.mjs";
14
+ import "../chunk-IU4DGONB.mjs";
15
15
  import "../chunk-OTXV5FY7.mjs";
16
16
  import "../chunk-VZIMT7AO.mjs";
17
17
  import "../chunk-I7CD6EB6.mjs";
@@ -3388,6 +3388,16 @@ var AttachLicenseQuantity$outboundSchema = z13.pipe(
3388
3388
  });
3389
3389
  })
3390
3390
  );
3391
+ var AttachRemoveDiscount$outboundSchema = z13.pipe(
3392
+ z13.object({
3393
+ rewardId: z13.string()
3394
+ }),
3395
+ z13.transform((v) => {
3396
+ return remap(v, {
3397
+ rewardId: "reward_id"
3398
+ });
3399
+ })
3400
+ );
3391
3401
  var AttachParams$outboundSchema = z13.pipe(
3392
3402
  z13.object({
3393
3403
  customerId: z13.string(),
@@ -3432,7 +3442,10 @@ var AttachParams$outboundSchema = z13.pipe(
3432
3442
  enablePlanImmediately: z13.optional(z13.boolean()),
3433
3443
  taxRateId: z13.optional(z13.string()),
3434
3444
  currency: z13.optional(z13.string()),
3435
- removePlanIds: z13.optional(z13.array(z13.string()))
3445
+ removePlanIds: z13.optional(z13.array(z13.string())),
3446
+ removeDiscounts: z13.optional(
3447
+ z13.array(z13.lazy(() => AttachRemoveDiscount$outboundSchema))
3448
+ )
3436
3449
  }),
3437
3450
  z13.transform((v) => {
3438
3451
  return remap(v, {
@@ -3461,7 +3474,8 @@ var AttachParams$outboundSchema = z13.pipe(
3461
3474
  noBillingChanges: "no_billing_changes",
3462
3475
  enablePlanImmediately: "enable_plan_immediately",
3463
3476
  taxRateId: "tax_rate_id",
3464
- removePlanIds: "remove_plan_ids"
3477
+ removePlanIds: "remove_plan_ids",
3478
+ removeDiscounts: "remove_discounts"
3465
3479
  });
3466
3480
  })
3467
3481
  );
@@ -36974,6 +36988,16 @@ var PreviewAttachLicenseQuantity$outboundSchema = z80.pipe(
36974
36988
  });
36975
36989
  })
36976
36990
  );
36991
+ var PreviewAttachRemoveDiscount$outboundSchema = z80.pipe(
36992
+ z80.object({
36993
+ rewardId: z80.string()
36994
+ }),
36995
+ z80.transform((v) => {
36996
+ return remap(v, {
36997
+ rewardId: "reward_id"
36998
+ });
36999
+ })
37000
+ );
36977
37001
  var PreviewAttachParams$outboundSchema = z80.pipe(
36978
37002
  z80.object({
36979
37003
  customerId: z80.string(),
@@ -37027,7 +37051,10 @@ var PreviewAttachParams$outboundSchema = z80.pipe(
37027
37051
  enablePlanImmediately: z80.optional(z80.boolean()),
37028
37052
  taxRateId: z80.optional(z80.string()),
37029
37053
  currency: z80.optional(z80.string()),
37030
- removePlanIds: z80.optional(z80.array(z80.string()))
37054
+ removePlanIds: z80.optional(z80.array(z80.string())),
37055
+ removeDiscounts: z80.optional(
37056
+ z80.array(z80.lazy(() => PreviewAttachRemoveDiscount$outboundSchema))
37057
+ )
37031
37058
  }),
37032
37059
  z80.transform((v) => {
37033
37060
  return remap(v, {
@@ -37056,7 +37083,8 @@ var PreviewAttachParams$outboundSchema = z80.pipe(
37056
37083
  noBillingChanges: "no_billing_changes",
37057
37084
  enablePlanImmediately: "enable_plan_immediately",
37058
37085
  taxRateId: "tax_rate_id",
37059
- removePlanIds: "remove_plan_ids"
37086
+ removePlanIds: "remove_plan_ids",
37087
+ removeDiscounts: "remove_discounts"
37060
37088
  });
37061
37089
  })
37062
37090
  );
@@ -43979,6 +44007,16 @@ var SetupPaymentLicenseQuantity$outboundSchema = z94.pipe(
43979
44007
  });
43980
44008
  })
43981
44009
  );
44010
+ var SetupPaymentRemoveDiscount$outboundSchema = z94.pipe(
44011
+ z94.object({
44012
+ rewardId: z94.string()
44013
+ }),
44014
+ z94.transform((v) => {
44015
+ return remap(v, {
44016
+ rewardId: "reward_id"
44017
+ });
44018
+ })
44019
+ );
43982
44020
  var SetupPaymentParams$outboundSchema = z94.pipe(
43983
44021
  z94.object({
43984
44022
  customerId: z94.string(),
@@ -44020,7 +44058,10 @@ var SetupPaymentParams$outboundSchema = z94.pipe(
44020
44058
  enablePlanImmediately: z94.optional(z94.boolean()),
44021
44059
  taxRateId: z94.optional(z94.string()),
44022
44060
  currency: z94.optional(z94.string()),
44023
- removePlanIds: z94.optional(z94.array(z94.string()))
44061
+ removePlanIds: z94.optional(z94.array(z94.string())),
44062
+ removeDiscounts: z94.optional(
44063
+ z94.array(z94.lazy(() => SetupPaymentRemoveDiscount$outboundSchema))
44064
+ )
44024
44065
  }),
44025
44066
  z94.transform((v) => {
44026
44067
  return remap(v, {
@@ -44044,7 +44085,8 @@ var SetupPaymentParams$outboundSchema = z94.pipe(
44044
44085
  noBillingChanges: "no_billing_changes",
44045
44086
  enablePlanImmediately: "enable_plan_immediately",
44046
44087
  taxRateId: "tax_rate_id",
44047
- removePlanIds: "remove_plan_ids"
44088
+ removePlanIds: "remove_plan_ids",
44089
+ removeDiscounts: "remove_discounts"
44048
44090
  });
44049
44091
  })
44050
44092
  );
@@ -54957,6 +54999,7 @@ var Billing = class extends ClientSDK {
54957
54999
  * @param taxRateId - Stripe tax rate ID (txr_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items. (optional)
54958
55000
  * @param currency - Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
54959
55001
  * @param removePlanIds - Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected. (optional)
55002
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
54960
55003
  *
54961
55004
  * @returns A billing response with customer ID, invoice details, and payment URL (if checkout required).
54962
55005
  */
@@ -55094,6 +55137,7 @@ var Billing = class extends ClientSDK {
55094
55137
  * @param taxRateId - Stripe tax rate ID (txr_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items. (optional)
55095
55138
  * @param currency - Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
55096
55139
  * @param removePlanIds - Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected. (optional)
55140
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
55097
55141
  *
55098
55142
  * @returns A preview response with line items, totals, and effective dates for the proposed changes.
55099
55143
  */
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Autumn
3
- } from "./chunk-RGGW7MYQ.mjs";
3
+ } from "./chunk-5MHFZETT.mjs";
4
4
  import {
5
5
  executeRoute
6
6
  } from "./chunk-MOHYGUMA.mjs";
7
7
  import {
8
8
  routeConfigs
9
- } from "./chunk-ET3EY5PE.mjs";
9
+ } from "./chunk-IU4DGONB.mjs";
10
10
  import {
11
11
  secretKeyCheck
12
12
  } from "./chunk-VZIMT7AO.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-KPND33EK.mjs";
3
+ } from "./chunk-UUXEUVUW.mjs";
4
4
 
5
5
  // src/backend/adapters/fetch.ts
6
6
  function autumnHandler(options) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-KPND33EK.mjs";
3
+ } from "./chunk-UUXEUVUW.mjs";
4
4
 
5
5
  // src/backend/adapters/next.ts
6
6
  import { NextResponse } from "next/server";
@@ -212,6 +212,9 @@ var attachLicenseQuantitySchema = z2.object({
212
212
  licensePlanId: z2.string(),
213
213
  quantity: z2.number()
214
214
  });
215
+ var attachRemoveDiscountSchema = z2.object({
216
+ rewardId: z2.string()
217
+ });
215
218
  var attachInvoiceSchema = z2.object({
216
219
  status: z2.string().nullable(),
217
220
  stripeId: z2.string(),
@@ -436,6 +439,9 @@ var attachLicenseQuantityOutboundSchema = z2.object({
436
439
  license_plan_id: z2.string(),
437
440
  quantity: z2.number()
438
441
  });
442
+ var attachRemoveDiscountOutboundSchema = z2.object({
443
+ reward_id: z2.string()
444
+ });
439
445
  var closedEnumSchema2 = z2.any();
440
446
  var attachUpsertLicenseThresholdBillingSchema = z2.any();
441
447
  var attachUpsertLicenseResetSchema = z2.any();
@@ -661,7 +667,8 @@ var attachParamsSchema = z2.object({
661
667
  enablePlanImmediately: z2.union([z2.boolean(), z2.undefined()]).optional(),
662
668
  taxRateId: z2.union([z2.string(), z2.undefined()]).optional(),
663
669
  currency: z2.union([z2.string(), z2.undefined()]).optional(),
664
- removePlanIds: z2.union([z2.array(z2.string()), z2.undefined()]).optional()
670
+ removePlanIds: z2.union([z2.array(z2.string()), z2.undefined()]).optional(),
671
+ removeDiscounts: z2.union([z2.array(attachRemoveDiscountSchema), z2.undefined()]).optional()
665
672
  });
666
673
  var attachCodeSchema = openEnumSchema2;
667
674
  var attachRequiredActionSchema = z2.object({
@@ -745,7 +752,8 @@ var attachParamsOutboundSchema = z2.object({
745
752
  enable_plan_immediately: z2.union([z2.boolean(), z2.undefined()]).optional(),
746
753
  tax_rate_id: z2.union([z2.string(), z2.undefined()]).optional(),
747
754
  currency: z2.union([z2.string(), z2.undefined()]).optional(),
748
- remove_plan_ids: z2.union([z2.array(z2.string()), z2.undefined()]).optional()
755
+ remove_plan_ids: z2.union([z2.array(z2.string()), z2.undefined()]).optional(),
756
+ remove_discounts: z2.union([z2.array(attachRemoveDiscountOutboundSchema), z2.undefined()]).optional()
749
757
  });
750
758
 
751
759
  // src/generated/createReferralCodeSchemas.ts
@@ -3012,6 +3020,9 @@ var previewAttachLicenseQuantitySchema = z12.object({
3012
3020
  licensePlanId: z12.string(),
3013
3021
  quantity: z12.number()
3014
3022
  });
3023
+ var previewAttachRemoveDiscountSchema = z12.object({
3024
+ rewardId: z12.string()
3025
+ });
3015
3026
  var previewAttachDiscountSchema = z12.object({
3016
3027
  amountOff: z12.number(),
3017
3028
  percentOff: z12.union([z12.number(), z12.undefined()]).optional(),
@@ -3300,6 +3311,9 @@ var previewAttachLicenseQuantityOutboundSchema = z12.object({
3300
3311
  license_plan_id: z12.string(),
3301
3312
  quantity: z12.number()
3302
3313
  });
3314
+ var previewAttachRemoveDiscountOutboundSchema = z12.object({
3315
+ reward_id: z12.string()
3316
+ });
3303
3317
  var closedEnumSchema8 = z12.any();
3304
3318
  var previewAttachUpsertLicenseThresholdBillingSchema = z12.any();
3305
3319
  var previewAttachUpsertLicenseResetSchema = z12.any();
@@ -3535,7 +3549,8 @@ var previewAttachParamsSchema = z12.object({
3535
3549
  enablePlanImmediately: z12.union([z12.boolean(), z12.undefined()]).optional(),
3536
3550
  taxRateId: z12.union([z12.string(), z12.undefined()]).optional(),
3537
3551
  currency: z12.union([z12.string(), z12.undefined()]).optional(),
3538
- removePlanIds: z12.union([z12.array(z12.string()), z12.undefined()]).optional()
3552
+ removePlanIds: z12.union([z12.array(z12.string()), z12.undefined()]).optional(),
3553
+ removeDiscounts: z12.union([z12.array(previewAttachRemoveDiscountSchema), z12.undefined()]).optional()
3539
3554
  });
3540
3555
  var previewAttachIncomingSchema = z12.object({
3541
3556
  planId: z12.string(),
@@ -3660,7 +3675,8 @@ var previewAttachParamsOutboundSchema = z12.object({
3660
3675
  enable_plan_immediately: z12.union([z12.boolean(), z12.undefined()]).optional(),
3661
3676
  tax_rate_id: z12.union([z12.string(), z12.undefined()]).optional(),
3662
3677
  currency: z12.union([z12.string(), z12.undefined()]).optional(),
3663
- remove_plan_ids: z12.union([z12.array(z12.string()), z12.undefined()]).optional()
3678
+ remove_plan_ids: z12.union([z12.array(z12.string()), z12.undefined()]).optional(),
3679
+ remove_discounts: z12.union([z12.array(previewAttachRemoveDiscountOutboundSchema), z12.undefined()]).optional()
3664
3680
  });
3665
3681
 
3666
3682
  // src/generated/previewMultiAttachSchemas.ts
@@ -5406,6 +5422,9 @@ var setupPaymentLicenseQuantitySchema = z16.object({
5406
5422
  licensePlanId: z16.string(),
5407
5423
  quantity: z16.number()
5408
5424
  });
5425
+ var setupPaymentRemoveDiscountSchema = z16.object({
5426
+ rewardId: z16.string()
5427
+ });
5409
5428
  var setupPaymentResponseSchema = z16.object({
5410
5429
  customerId: z16.string(),
5411
5430
  entityId: z16.union([z16.string(), z16.undefined()]).optional(),
@@ -5613,6 +5632,9 @@ var setupPaymentLicenseQuantityOutboundSchema = z16.object({
5613
5632
  license_plan_id: z16.string(),
5614
5633
  quantity: z16.number()
5615
5634
  });
5635
+ var setupPaymentRemoveDiscountOutboundSchema = z16.object({
5636
+ reward_id: z16.string()
5637
+ });
5616
5638
  var closedEnumSchema11 = z16.any();
5617
5639
  var setupPaymentUpsertLicenseThresholdBillingSchema = z16.any();
5618
5640
  var setupPaymentUpsertLicenseResetSchema = z16.any();
@@ -5836,7 +5858,8 @@ var setupPaymentParamsSchema = z16.object({
5836
5858
  enablePlanImmediately: z16.union([z16.boolean(), z16.undefined()]).optional(),
5837
5859
  taxRateId: z16.union([z16.string(), z16.undefined()]).optional(),
5838
5860
  currency: z16.union([z16.string(), z16.undefined()]).optional(),
5839
- removePlanIds: z16.union([z16.array(z16.string()), z16.undefined()]).optional()
5861
+ removePlanIds: z16.union([z16.array(z16.string()), z16.undefined()]).optional(),
5862
+ removeDiscounts: z16.union([z16.array(setupPaymentRemoveDiscountSchema), z16.undefined()]).optional()
5840
5863
  });
5841
5864
  var setupPaymentUpsertLicensePlanItemOutboundSchema = z16.object({
5842
5865
  threshold_billing: z16.union([
@@ -5912,7 +5935,8 @@ var setupPaymentParamsOutboundSchema = z16.object({
5912
5935
  enable_plan_immediately: z16.union([z16.boolean(), z16.undefined()]).optional(),
5913
5936
  tax_rate_id: z16.union([z16.string(), z16.undefined()]).optional(),
5914
5937
  currency: z16.union([z16.string(), z16.undefined()]).optional(),
5915
- remove_plan_ids: z16.union([z16.array(z16.string()), z16.undefined()]).optional()
5938
+ remove_plan_ids: z16.union([z16.array(z16.string()), z16.undefined()]).optional(),
5939
+ remove_discounts: z16.union([z16.array(setupPaymentRemoveDiscountOutboundSchema), z16.undefined()]).optional()
5916
5940
  });
5917
5941
 
5918
5942
  // src/generated/updateSubscriptionSchemas.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-KPND33EK.mjs";
3
+ } from "./chunk-UUXEUVUW.mjs";
4
4
 
5
5
  // src/backend/adapters/express.ts
6
6
  function autumnHandler(options) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Autumn
3
- } from "./chunk-RGGW7MYQ.mjs";
3
+ } from "./chunk-5MHFZETT.mjs";
4
4
  import {
5
5
  executeRoute
6
6
  } from "./chunk-MOHYGUMA.mjs";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-UAR3TMWI.mjs";
10
10
  import {
11
11
  routeConfigs
12
- } from "./chunk-ET3EY5PE.mjs";
12
+ } from "./chunk-IU4DGONB.mjs";
13
13
  import {
14
14
  secretKeyCheck
15
15
  } from "./chunk-VZIMT7AO.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-KPND33EK.mjs";
3
+ } from "./chunk-UUXEUVUW.mjs";
4
4
 
5
5
  // src/backend/adapters/hono.ts
6
6
  function autumnHandler(options) {
@@ -1,6 +1,6 @@
1
1
  import { CoreHandlerOptions, UnifiedRequest, UnifiedResponse } from '../types/handlerTypes.mjs';
2
2
  import '../../authTypes-TPWTIfcM.mjs';
3
- import '../../routeTypes-CVNEIkWv.mjs';
3
+ import '../../routeTypes-BDhI1aVG.mjs';
4
4
  import 'zod/v4';
5
5
  import '../utils/sanitizeBody.mjs';
6
6
  import '../types/responseTypes.mjs';
@@ -1,6 +1,6 @@
1
1
  import { CoreHandlerOptions, UnifiedRequest, UnifiedResponse } from '../types/handlerTypes.js';
2
2
  import '../../authTypes-TPWTIfcM.js';
3
- import '../../routeTypes-DRaLLtYM.js';
3
+ import '../../routeTypes-S7the8kq.js';
4
4
  import 'zod/v4';
5
5
  import '../utils/sanitizeBody.js';
6
6
  import '../types/responseTypes.js';