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
@@ -2616,6 +2616,15 @@ type AttachLicenseQuantity = {
2616
2616
  */
2617
2617
  quantity: number;
2618
2618
  };
2619
+ /**
2620
+ * A discount to remove from the subscription. Discounts that are no longer applied are ignored.
2621
+ */
2622
+ type AttachRemoveDiscount = {
2623
+ /**
2624
+ * The ID of the reward (or Stripe coupon) to remove.
2625
+ */
2626
+ rewardId: string;
2627
+ };
2619
2628
  type AttachParams = {
2620
2629
  /**
2621
2630
  * The ID of the customer to attach the plan to.
@@ -2745,6 +2754,10 @@ type AttachParams = {
2745
2754
  * 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.
2746
2755
  */
2747
2756
  removePlanIds?: Array<string> | undefined;
2757
+ /**
2758
+ * Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged.
2759
+ */
2760
+ removeDiscounts?: Array<AttachRemoveDiscount> | undefined;
2748
2761
  };
2749
2762
  /**
2750
2763
  * Invoice details if an invoice was created. Only present when a charge was made.
@@ -43042,6 +43055,15 @@ type PreviewAttachLicenseQuantity = {
43042
43055
  */
43043
43056
  quantity: number;
43044
43057
  };
43058
+ /**
43059
+ * A discount to remove from the subscription. Discounts that are no longer applied are ignored.
43060
+ */
43061
+ type PreviewAttachRemoveDiscount = {
43062
+ /**
43063
+ * The ID of the reward (or Stripe coupon) to remove.
43064
+ */
43065
+ rewardId: string;
43066
+ };
43045
43067
  type PreviewAttachParams = {
43046
43068
  /**
43047
43069
  * The ID of the customer to attach the plan to.
@@ -43171,6 +43193,10 @@ type PreviewAttachParams = {
43171
43193
  * 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.
43172
43194
  */
43173
43195
  removePlanIds?: Array<string> | undefined;
43196
+ /**
43197
+ * Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged.
43198
+ */
43199
+ removeDiscounts?: Array<PreviewAttachRemoveDiscount> | undefined;
43174
43200
  };
43175
43201
  type PreviewAttachDiscount = {
43176
43202
  amountOff: number;
@@ -51310,6 +51336,15 @@ type SetupPaymentLicenseQuantity = {
51310
51336
  */
51311
51337
  quantity: number;
51312
51338
  };
51339
+ /**
51340
+ * A discount to remove from the subscription. Discounts that are no longer applied are ignored.
51341
+ */
51342
+ type SetupPaymentRemoveDiscount = {
51343
+ /**
51344
+ * The ID of the reward (or Stripe coupon) to remove.
51345
+ */
51346
+ rewardId: string;
51347
+ };
51313
51348
  type SetupPaymentParams = {
51314
51349
  /**
51315
51350
  * The ID of the customer to attach the plan to.
@@ -51419,6 +51454,10 @@ type SetupPaymentParams = {
51419
51454
  * 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.
51420
51455
  */
51421
51456
  removePlanIds?: Array<string> | undefined;
51457
+ /**
51458
+ * Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged.
51459
+ */
51460
+ removeDiscounts?: Array<SetupPaymentRemoveDiscount> | undefined;
51422
51461
  };
51423
51462
  /**
51424
51463
  * OK
@@ -61808,6 +61847,7 @@ declare class Billing extends ClientSDK {
61808
61847
  * @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)
61809
61848
  * @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)
61810
61849
  * @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)
61850
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
61811
61851
  *
61812
61852
  * @returns A billing response with customer ID, invoice details, and payment URL (if checkout required).
61813
61853
  */
@@ -61927,6 +61967,7 @@ declare class Billing extends ClientSDK {
61927
61967
  * @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)
61928
61968
  * @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)
61929
61969
  * @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)
61970
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
61930
61971
  *
61931
61972
  * @returns A preview response with line items, totals, and effective dates for the proposed changes.
61932
61973
  */
@@ -2616,6 +2616,15 @@ type AttachLicenseQuantity = {
2616
2616
  */
2617
2617
  quantity: number;
2618
2618
  };
2619
+ /**
2620
+ * A discount to remove from the subscription. Discounts that are no longer applied are ignored.
2621
+ */
2622
+ type AttachRemoveDiscount = {
2623
+ /**
2624
+ * The ID of the reward (or Stripe coupon) to remove.
2625
+ */
2626
+ rewardId: string;
2627
+ };
2619
2628
  type AttachParams = {
2620
2629
  /**
2621
2630
  * The ID of the customer to attach the plan to.
@@ -2745,6 +2754,10 @@ type AttachParams = {
2745
2754
  * 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.
2746
2755
  */
2747
2756
  removePlanIds?: Array<string> | undefined;
2757
+ /**
2758
+ * Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged.
2759
+ */
2760
+ removeDiscounts?: Array<AttachRemoveDiscount> | undefined;
2748
2761
  };
2749
2762
  /**
2750
2763
  * Invoice details if an invoice was created. Only present when a charge was made.
@@ -43042,6 +43055,15 @@ type PreviewAttachLicenseQuantity = {
43042
43055
  */
43043
43056
  quantity: number;
43044
43057
  };
43058
+ /**
43059
+ * A discount to remove from the subscription. Discounts that are no longer applied are ignored.
43060
+ */
43061
+ type PreviewAttachRemoveDiscount = {
43062
+ /**
43063
+ * The ID of the reward (or Stripe coupon) to remove.
43064
+ */
43065
+ rewardId: string;
43066
+ };
43045
43067
  type PreviewAttachParams = {
43046
43068
  /**
43047
43069
  * The ID of the customer to attach the plan to.
@@ -43171,6 +43193,10 @@ type PreviewAttachParams = {
43171
43193
  * 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.
43172
43194
  */
43173
43195
  removePlanIds?: Array<string> | undefined;
43196
+ /**
43197
+ * Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged.
43198
+ */
43199
+ removeDiscounts?: Array<PreviewAttachRemoveDiscount> | undefined;
43174
43200
  };
43175
43201
  type PreviewAttachDiscount = {
43176
43202
  amountOff: number;
@@ -51310,6 +51336,15 @@ type SetupPaymentLicenseQuantity = {
51310
51336
  */
51311
51337
  quantity: number;
51312
51338
  };
51339
+ /**
51340
+ * A discount to remove from the subscription. Discounts that are no longer applied are ignored.
51341
+ */
51342
+ type SetupPaymentRemoveDiscount = {
51343
+ /**
51344
+ * The ID of the reward (or Stripe coupon) to remove.
51345
+ */
51346
+ rewardId: string;
51347
+ };
51313
51348
  type SetupPaymentParams = {
51314
51349
  /**
51315
51350
  * The ID of the customer to attach the plan to.
@@ -51419,6 +51454,10 @@ type SetupPaymentParams = {
51419
51454
  * 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.
51420
51455
  */
51421
51456
  removePlanIds?: Array<string> | undefined;
51457
+ /**
51458
+ * Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged.
51459
+ */
51460
+ removeDiscounts?: Array<SetupPaymentRemoveDiscount> | undefined;
51422
51461
  };
51423
51462
  /**
51424
51463
  * OK
@@ -61808,6 +61847,7 @@ declare class Billing extends ClientSDK {
61808
61847
  * @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)
61809
61848
  * @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)
61810
61849
  * @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)
61850
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
61811
61851
  *
61812
61852
  * @returns A billing response with customer ID, invoice details, and payment URL (if checkout required).
61813
61853
  */
@@ -61927,6 +61967,7 @@ declare class Billing extends ClientSDK {
61927
61967
  * @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)
61928
61968
  * @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)
61929
61969
  * @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)
61970
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
61930
61971
  *
61931
61972
  * @returns A preview response with line items, totals, and effective dates for the proposed changes.
61932
61973
  */
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  routeConfigs
3
- } from "./chunk-LCFFOKLD.mjs";
3
+ } from "./chunk-IZPM54OK.mjs";
4
4
  import {
5
5
  omitProtectedBodyFields
6
6
  } from "./chunk-GJAMWZNZ.mjs";
@@ -203,6 +203,9 @@ var attachLicenseQuantitySchema = z2.object({
203
203
  licensePlanId: z2.string(),
204
204
  quantity: z2.number()
205
205
  });
206
+ var attachRemoveDiscountSchema = z2.object({
207
+ rewardId: z2.string()
208
+ });
206
209
  var attachInvoiceSchema = z2.object({
207
210
  status: z2.string().nullable(),
208
211
  stripeId: z2.string(),
@@ -427,6 +430,9 @@ var attachLicenseQuantityOutboundSchema = z2.object({
427
430
  license_plan_id: z2.string(),
428
431
  quantity: z2.number()
429
432
  });
433
+ var attachRemoveDiscountOutboundSchema = z2.object({
434
+ reward_id: z2.string()
435
+ });
430
436
  var closedEnumSchema2 = z2.any();
431
437
  var attachUpsertLicenseThresholdBillingSchema = z2.any();
432
438
  var attachUpsertLicenseResetSchema = z2.any();
@@ -652,7 +658,8 @@ var attachParamsSchema = z2.object({
652
658
  enablePlanImmediately: z2.union([z2.boolean(), z2.undefined()]).optional(),
653
659
  taxRateId: z2.union([z2.string(), z2.undefined()]).optional(),
654
660
  currency: z2.union([z2.string(), z2.undefined()]).optional(),
655
- removePlanIds: z2.union([z2.array(z2.string()), z2.undefined()]).optional()
661
+ removePlanIds: z2.union([z2.array(z2.string()), z2.undefined()]).optional(),
662
+ removeDiscounts: z2.union([z2.array(attachRemoveDiscountSchema), z2.undefined()]).optional()
656
663
  });
657
664
  var attachCodeSchema = openEnumSchema2;
658
665
  var attachRequiredActionSchema = z2.object({
@@ -736,7 +743,8 @@ var attachParamsOutboundSchema = z2.object({
736
743
  enable_plan_immediately: z2.union([z2.boolean(), z2.undefined()]).optional(),
737
744
  tax_rate_id: z2.union([z2.string(), z2.undefined()]).optional(),
738
745
  currency: z2.union([z2.string(), z2.undefined()]).optional(),
739
- remove_plan_ids: z2.union([z2.array(z2.string()), z2.undefined()]).optional()
746
+ remove_plan_ids: z2.union([z2.array(z2.string()), z2.undefined()]).optional(),
747
+ remove_discounts: z2.union([z2.array(attachRemoveDiscountOutboundSchema), z2.undefined()]).optional()
740
748
  });
741
749
 
742
750
  // src/generated/createReferralCodeSchemas.ts
@@ -3003,6 +3011,9 @@ var previewAttachLicenseQuantitySchema = z12.object({
3003
3011
  licensePlanId: z12.string(),
3004
3012
  quantity: z12.number()
3005
3013
  });
3014
+ var previewAttachRemoveDiscountSchema = z12.object({
3015
+ rewardId: z12.string()
3016
+ });
3006
3017
  var previewAttachDiscountSchema = z12.object({
3007
3018
  amountOff: z12.number(),
3008
3019
  percentOff: z12.union([z12.number(), z12.undefined()]).optional(),
@@ -3291,6 +3302,9 @@ var previewAttachLicenseQuantityOutboundSchema = z12.object({
3291
3302
  license_plan_id: z12.string(),
3292
3303
  quantity: z12.number()
3293
3304
  });
3305
+ var previewAttachRemoveDiscountOutboundSchema = z12.object({
3306
+ reward_id: z12.string()
3307
+ });
3294
3308
  var closedEnumSchema8 = z12.any();
3295
3309
  var previewAttachUpsertLicenseThresholdBillingSchema = z12.any();
3296
3310
  var previewAttachUpsertLicenseResetSchema = z12.any();
@@ -3526,7 +3540,8 @@ var previewAttachParamsSchema = z12.object({
3526
3540
  enablePlanImmediately: z12.union([z12.boolean(), z12.undefined()]).optional(),
3527
3541
  taxRateId: z12.union([z12.string(), z12.undefined()]).optional(),
3528
3542
  currency: z12.union([z12.string(), z12.undefined()]).optional(),
3529
- removePlanIds: z12.union([z12.array(z12.string()), z12.undefined()]).optional()
3543
+ removePlanIds: z12.union([z12.array(z12.string()), z12.undefined()]).optional(),
3544
+ removeDiscounts: z12.union([z12.array(previewAttachRemoveDiscountSchema), z12.undefined()]).optional()
3530
3545
  });
3531
3546
  var previewAttachIncomingSchema = z12.object({
3532
3547
  planId: z12.string(),
@@ -3651,7 +3666,8 @@ var previewAttachParamsOutboundSchema = z12.object({
3651
3666
  enable_plan_immediately: z12.union([z12.boolean(), z12.undefined()]).optional(),
3652
3667
  tax_rate_id: z12.union([z12.string(), z12.undefined()]).optional(),
3653
3668
  currency: z12.union([z12.string(), z12.undefined()]).optional(),
3654
- remove_plan_ids: z12.union([z12.array(z12.string()), z12.undefined()]).optional()
3669
+ remove_plan_ids: z12.union([z12.array(z12.string()), z12.undefined()]).optional(),
3670
+ remove_discounts: z12.union([z12.array(previewAttachRemoveDiscountOutboundSchema), z12.undefined()]).optional()
3655
3671
  });
3656
3672
 
3657
3673
  // src/generated/previewMultiAttachSchemas.ts
@@ -5397,6 +5413,9 @@ var setupPaymentLicenseQuantitySchema = z16.object({
5397
5413
  licensePlanId: z16.string(),
5398
5414
  quantity: z16.number()
5399
5415
  });
5416
+ var setupPaymentRemoveDiscountSchema = z16.object({
5417
+ rewardId: z16.string()
5418
+ });
5400
5419
  var setupPaymentResponseSchema = z16.object({
5401
5420
  customerId: z16.string(),
5402
5421
  entityId: z16.union([z16.string(), z16.undefined()]).optional(),
@@ -5604,6 +5623,9 @@ var setupPaymentLicenseQuantityOutboundSchema = z16.object({
5604
5623
  license_plan_id: z16.string(),
5605
5624
  quantity: z16.number()
5606
5625
  });
5626
+ var setupPaymentRemoveDiscountOutboundSchema = z16.object({
5627
+ reward_id: z16.string()
5628
+ });
5607
5629
  var closedEnumSchema11 = z16.any();
5608
5630
  var setupPaymentUpsertLicenseThresholdBillingSchema = z16.any();
5609
5631
  var setupPaymentUpsertLicenseResetSchema = z16.any();
@@ -5827,7 +5849,8 @@ var setupPaymentParamsSchema = z16.object({
5827
5849
  enablePlanImmediately: z16.union([z16.boolean(), z16.undefined()]).optional(),
5828
5850
  taxRateId: z16.union([z16.string(), z16.undefined()]).optional(),
5829
5851
  currency: z16.union([z16.string(), z16.undefined()]).optional(),
5830
- removePlanIds: z16.union([z16.array(z16.string()), z16.undefined()]).optional()
5852
+ removePlanIds: z16.union([z16.array(z16.string()), z16.undefined()]).optional(),
5853
+ removeDiscounts: z16.union([z16.array(setupPaymentRemoveDiscountSchema), z16.undefined()]).optional()
5831
5854
  });
5832
5855
  var setupPaymentUpsertLicensePlanItemOutboundSchema = z16.object({
5833
5856
  threshold_billing: z16.union([
@@ -5903,7 +5926,8 @@ var setupPaymentParamsOutboundSchema = z16.object({
5903
5926
  enable_plan_immediately: z16.union([z16.boolean(), z16.undefined()]).optional(),
5904
5927
  tax_rate_id: z16.union([z16.string(), z16.undefined()]).optional(),
5905
5928
  currency: z16.union([z16.string(), z16.undefined()]).optional(),
5906
- remove_plan_ids: z16.union([z16.array(z16.string()), z16.undefined()]).optional()
5929
+ remove_plan_ids: z16.union([z16.array(z16.string()), z16.undefined()]).optional(),
5930
+ remove_discounts: z16.union([z16.array(setupPaymentRemoveDiscountOutboundSchema), z16.undefined()]).optional()
5907
5931
  });
5908
5932
 
5909
5933
  // src/generated/updateSubscriptionSchemas.ts
@@ -8,7 +8,7 @@ import {
8
8
  routeConfigs,
9
9
  sanitizeBody,
10
10
  secretKeyCheck
11
- } from "./chunk-LCFFOKLD.mjs";
11
+ } from "./chunk-IZPM54OK.mjs";
12
12
  import {
13
13
  getActiveOrganization
14
14
  } from "./chunk-BT3EAYVW.mjs";
@@ -3453,6 +3453,16 @@ var AttachLicenseQuantity$outboundSchema = z13.pipe(
3453
3453
  });
3454
3454
  })
3455
3455
  );
3456
+ var AttachRemoveDiscount$outboundSchema = z13.pipe(
3457
+ z13.object({
3458
+ rewardId: z13.string()
3459
+ }),
3460
+ z13.transform((v) => {
3461
+ return remap(v, {
3462
+ rewardId: "reward_id"
3463
+ });
3464
+ })
3465
+ );
3456
3466
  var AttachParams$outboundSchema = z13.pipe(
3457
3467
  z13.object({
3458
3468
  customerId: z13.string(),
@@ -3497,7 +3507,10 @@ var AttachParams$outboundSchema = z13.pipe(
3497
3507
  enablePlanImmediately: z13.optional(z13.boolean()),
3498
3508
  taxRateId: z13.optional(z13.string()),
3499
3509
  currency: z13.optional(z13.string()),
3500
- removePlanIds: z13.optional(z13.array(z13.string()))
3510
+ removePlanIds: z13.optional(z13.array(z13.string())),
3511
+ removeDiscounts: z13.optional(
3512
+ z13.array(z13.lazy(() => AttachRemoveDiscount$outboundSchema))
3513
+ )
3501
3514
  }),
3502
3515
  z13.transform((v) => {
3503
3516
  return remap(v, {
@@ -3526,7 +3539,8 @@ var AttachParams$outboundSchema = z13.pipe(
3526
3539
  noBillingChanges: "no_billing_changes",
3527
3540
  enablePlanImmediately: "enable_plan_immediately",
3528
3541
  taxRateId: "tax_rate_id",
3529
- removePlanIds: "remove_plan_ids"
3542
+ removePlanIds: "remove_plan_ids",
3543
+ removeDiscounts: "remove_discounts"
3530
3544
  });
3531
3545
  })
3532
3546
  );
@@ -37039,6 +37053,16 @@ var PreviewAttachLicenseQuantity$outboundSchema = z80.pipe(
37039
37053
  });
37040
37054
  })
37041
37055
  );
37056
+ var PreviewAttachRemoveDiscount$outboundSchema = z80.pipe(
37057
+ z80.object({
37058
+ rewardId: z80.string()
37059
+ }),
37060
+ z80.transform((v) => {
37061
+ return remap(v, {
37062
+ rewardId: "reward_id"
37063
+ });
37064
+ })
37065
+ );
37042
37066
  var PreviewAttachParams$outboundSchema = z80.pipe(
37043
37067
  z80.object({
37044
37068
  customerId: z80.string(),
@@ -37092,7 +37116,10 @@ var PreviewAttachParams$outboundSchema = z80.pipe(
37092
37116
  enablePlanImmediately: z80.optional(z80.boolean()),
37093
37117
  taxRateId: z80.optional(z80.string()),
37094
37118
  currency: z80.optional(z80.string()),
37095
- removePlanIds: z80.optional(z80.array(z80.string()))
37119
+ removePlanIds: z80.optional(z80.array(z80.string())),
37120
+ removeDiscounts: z80.optional(
37121
+ z80.array(z80.lazy(() => PreviewAttachRemoveDiscount$outboundSchema))
37122
+ )
37096
37123
  }),
37097
37124
  z80.transform((v) => {
37098
37125
  return remap(v, {
@@ -37121,7 +37148,8 @@ var PreviewAttachParams$outboundSchema = z80.pipe(
37121
37148
  noBillingChanges: "no_billing_changes",
37122
37149
  enablePlanImmediately: "enable_plan_immediately",
37123
37150
  taxRateId: "tax_rate_id",
37124
- removePlanIds: "remove_plan_ids"
37151
+ removePlanIds: "remove_plan_ids",
37152
+ removeDiscounts: "remove_discounts"
37125
37153
  });
37126
37154
  })
37127
37155
  );
@@ -44044,6 +44072,16 @@ var SetupPaymentLicenseQuantity$outboundSchema = z94.pipe(
44044
44072
  });
44045
44073
  })
44046
44074
  );
44075
+ var SetupPaymentRemoveDiscount$outboundSchema = z94.pipe(
44076
+ z94.object({
44077
+ rewardId: z94.string()
44078
+ }),
44079
+ z94.transform((v) => {
44080
+ return remap(v, {
44081
+ rewardId: "reward_id"
44082
+ });
44083
+ })
44084
+ );
44047
44085
  var SetupPaymentParams$outboundSchema = z94.pipe(
44048
44086
  z94.object({
44049
44087
  customerId: z94.string(),
@@ -44085,7 +44123,10 @@ var SetupPaymentParams$outboundSchema = z94.pipe(
44085
44123
  enablePlanImmediately: z94.optional(z94.boolean()),
44086
44124
  taxRateId: z94.optional(z94.string()),
44087
44125
  currency: z94.optional(z94.string()),
44088
- removePlanIds: z94.optional(z94.array(z94.string()))
44126
+ removePlanIds: z94.optional(z94.array(z94.string())),
44127
+ removeDiscounts: z94.optional(
44128
+ z94.array(z94.lazy(() => SetupPaymentRemoveDiscount$outboundSchema))
44129
+ )
44089
44130
  }),
44090
44131
  z94.transform((v) => {
44091
44132
  return remap(v, {
@@ -44109,7 +44150,8 @@ var SetupPaymentParams$outboundSchema = z94.pipe(
44109
44150
  noBillingChanges: "no_billing_changes",
44110
44151
  enablePlanImmediately: "enable_plan_immediately",
44111
44152
  taxRateId: "tax_rate_id",
44112
- removePlanIds: "remove_plan_ids"
44153
+ removePlanIds: "remove_plan_ids",
44154
+ removeDiscounts: "remove_discounts"
44113
44155
  });
44114
44156
  })
44115
44157
  );
@@ -54994,6 +55036,7 @@ var Billing = class extends ClientSDK {
54994
55036
  * @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)
54995
55037
  * @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)
54996
55038
  * @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)
55039
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
54997
55040
  *
54998
55041
  * @returns A billing response with customer ID, invoice details, and payment URL (if checkout required).
54999
55042
  */
@@ -55131,6 +55174,7 @@ var Billing = class extends ClientSDK {
55131
55174
  * @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)
55132
55175
  * @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)
55133
55176
  * @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)
55177
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
55134
55178
  *
55135
55179
  * @returns A preview response with line items, totals, and effective dates for the proposed changes.
55136
55180
  */