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
package/dist/sdk/index.js CHANGED
@@ -4430,6 +4430,21 @@ function attachLicenseQuantityToJSON(attachLicenseQuantity) {
4430
4430
  AttachLicenseQuantity$outboundSchema.parse(attachLicenseQuantity)
4431
4431
  );
4432
4432
  }
4433
+ var AttachRemoveDiscount$outboundSchema = z34__namespace.pipe(
4434
+ z34__namespace.object({
4435
+ rewardId: z34__namespace.string()
4436
+ }),
4437
+ z34__namespace.transform((v) => {
4438
+ return remap(v, {
4439
+ rewardId: "reward_id"
4440
+ });
4441
+ })
4442
+ );
4443
+ function attachRemoveDiscountToJSON(attachRemoveDiscount) {
4444
+ return JSON.stringify(
4445
+ AttachRemoveDiscount$outboundSchema.parse(attachRemoveDiscount)
4446
+ );
4447
+ }
4433
4448
  var AttachParams$outboundSchema = z34__namespace.pipe(
4434
4449
  z34__namespace.object({
4435
4450
  customerId: z34__namespace.string(),
@@ -4474,7 +4489,10 @@ var AttachParams$outboundSchema = z34__namespace.pipe(
4474
4489
  enablePlanImmediately: z34__namespace.optional(z34__namespace.boolean()),
4475
4490
  taxRateId: z34__namespace.optional(z34__namespace.string()),
4476
4491
  currency: z34__namespace.optional(z34__namespace.string()),
4477
- removePlanIds: z34__namespace.optional(z34__namespace.array(z34__namespace.string()))
4492
+ removePlanIds: z34__namespace.optional(z34__namespace.array(z34__namespace.string())),
4493
+ removeDiscounts: z34__namespace.optional(
4494
+ z34__namespace.array(z34__namespace.lazy(() => AttachRemoveDiscount$outboundSchema))
4495
+ )
4478
4496
  }),
4479
4497
  z34__namespace.transform((v) => {
4480
4498
  return remap(v, {
@@ -4503,7 +4521,8 @@ var AttachParams$outboundSchema = z34__namespace.pipe(
4503
4521
  noBillingChanges: "no_billing_changes",
4504
4522
  enablePlanImmediately: "enable_plan_immediately",
4505
4523
  taxRateId: "tax_rate_id",
4506
- removePlanIds: "remove_plan_ids"
4524
+ removePlanIds: "remove_plan_ids",
4525
+ removeDiscounts: "remove_discounts"
4507
4526
  });
4508
4527
  })
4509
4528
  );
@@ -53890,6 +53909,23 @@ function previewAttachLicenseQuantityToJSON(previewAttachLicenseQuantity) {
53890
53909
  )
53891
53910
  );
53892
53911
  }
53912
+ var PreviewAttachRemoveDiscount$outboundSchema = z34__namespace.pipe(
53913
+ z34__namespace.object({
53914
+ rewardId: z34__namespace.string()
53915
+ }),
53916
+ z34__namespace.transform((v) => {
53917
+ return remap(v, {
53918
+ rewardId: "reward_id"
53919
+ });
53920
+ })
53921
+ );
53922
+ function previewAttachRemoveDiscountToJSON(previewAttachRemoveDiscount) {
53923
+ return JSON.stringify(
53924
+ PreviewAttachRemoveDiscount$outboundSchema.parse(
53925
+ previewAttachRemoveDiscount
53926
+ )
53927
+ );
53928
+ }
53893
53929
  var PreviewAttachParams$outboundSchema = z34__namespace.pipe(
53894
53930
  z34__namespace.object({
53895
53931
  customerId: z34__namespace.string(),
@@ -53943,7 +53979,10 @@ var PreviewAttachParams$outboundSchema = z34__namespace.pipe(
53943
53979
  enablePlanImmediately: z34__namespace.optional(z34__namespace.boolean()),
53944
53980
  taxRateId: z34__namespace.optional(z34__namespace.string()),
53945
53981
  currency: z34__namespace.optional(z34__namespace.string()),
53946
- removePlanIds: z34__namespace.optional(z34__namespace.array(z34__namespace.string()))
53982
+ removePlanIds: z34__namespace.optional(z34__namespace.array(z34__namespace.string())),
53983
+ removeDiscounts: z34__namespace.optional(
53984
+ z34__namespace.array(z34__namespace.lazy(() => PreviewAttachRemoveDiscount$outboundSchema))
53985
+ )
53947
53986
  }),
53948
53987
  z34__namespace.transform((v) => {
53949
53988
  return remap(v, {
@@ -53972,7 +54011,8 @@ var PreviewAttachParams$outboundSchema = z34__namespace.pipe(
53972
54011
  noBillingChanges: "no_billing_changes",
53973
54012
  enablePlanImmediately: "enable_plan_immediately",
53974
54013
  taxRateId: "tax_rate_id",
53975
- removePlanIds: "remove_plan_ids"
54014
+ removePlanIds: "remove_plan_ids",
54015
+ removeDiscounts: "remove_discounts"
53976
54016
  });
53977
54017
  })
53978
54018
  );
@@ -64176,6 +64216,21 @@ function setupPaymentLicenseQuantityToJSON(setupPaymentLicenseQuantity) {
64176
64216
  )
64177
64217
  );
64178
64218
  }
64219
+ var SetupPaymentRemoveDiscount$outboundSchema = z34__namespace.pipe(
64220
+ z34__namespace.object({
64221
+ rewardId: z34__namespace.string()
64222
+ }),
64223
+ z34__namespace.transform((v) => {
64224
+ return remap(v, {
64225
+ rewardId: "reward_id"
64226
+ });
64227
+ })
64228
+ );
64229
+ function setupPaymentRemoveDiscountToJSON(setupPaymentRemoveDiscount) {
64230
+ return JSON.stringify(
64231
+ SetupPaymentRemoveDiscount$outboundSchema.parse(setupPaymentRemoveDiscount)
64232
+ );
64233
+ }
64179
64234
  var SetupPaymentParams$outboundSchema = z34__namespace.pipe(
64180
64235
  z34__namespace.object({
64181
64236
  customerId: z34__namespace.string(),
@@ -64217,7 +64272,10 @@ var SetupPaymentParams$outboundSchema = z34__namespace.pipe(
64217
64272
  enablePlanImmediately: z34__namespace.optional(z34__namespace.boolean()),
64218
64273
  taxRateId: z34__namespace.optional(z34__namespace.string()),
64219
64274
  currency: z34__namespace.optional(z34__namespace.string()),
64220
- removePlanIds: z34__namespace.optional(z34__namespace.array(z34__namespace.string()))
64275
+ removePlanIds: z34__namespace.optional(z34__namespace.array(z34__namespace.string())),
64276
+ removeDiscounts: z34__namespace.optional(
64277
+ z34__namespace.array(z34__namespace.lazy(() => SetupPaymentRemoveDiscount$outboundSchema))
64278
+ )
64221
64279
  }),
64222
64280
  z34__namespace.transform((v) => {
64223
64281
  return remap(v, {
@@ -64241,7 +64299,8 @@ var SetupPaymentParams$outboundSchema = z34__namespace.pipe(
64241
64299
  noBillingChanges: "no_billing_changes",
64242
64300
  enablePlanImmediately: "enable_plan_immediately",
64243
64301
  taxRateId: "tax_rate_id",
64244
- removePlanIds: "remove_plan_ids"
64302
+ removePlanIds: "remove_plan_ids",
64303
+ removeDiscounts: "remove_discounts"
64245
64304
  });
64246
64305
  })
64247
64306
  );
@@ -79175,6 +79234,7 @@ var Billing = class extends ClientSDK {
79175
79234
  * @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)
79176
79235
  * @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)
79177
79236
  * @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)
79237
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
79178
79238
  *
79179
79239
  * @returns A billing response with customer ID, invoice details, and payment URL (if checkout required).
79180
79240
  */
@@ -79312,6 +79372,7 @@ var Billing = class extends ClientSDK {
79312
79372
  * @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)
79313
79373
  * @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)
79314
79374
  * @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)
79375
+ * @param removeDiscounts - Discounts to remove from the subscription, by reward ID. Discounts not listed are left unchanged. (optional)
79315
79376
  *
79316
79377
  * @returns A preview response with line items, totals, and effective dates for the proposed changes.
79317
79378
  */
@@ -85365,6 +85426,7 @@ exports.AttachProrationBehavior$outboundSchema = AttachProrationBehavior$outboun
85365
85426
  exports.AttachPurchaseLimit$outboundSchema = AttachPurchaseLimit$outboundSchema;
85366
85427
  exports.AttachRedirectMode = AttachRedirectMode;
85367
85428
  exports.AttachRedirectMode$outboundSchema = AttachRedirectMode$outboundSchema;
85429
+ exports.AttachRemoveDiscount$outboundSchema = AttachRemoveDiscount$outboundSchema;
85368
85430
  exports.AttachRemoveItemBillingMethod = AttachRemoveItemBillingMethod;
85369
85431
  exports.AttachRemoveItemBillingMethod$outboundSchema = AttachRemoveItemBillingMethod$outboundSchema;
85370
85432
  exports.AttachRemoveLicense$outboundSchema = AttachRemoveLicense$outboundSchema;
@@ -89141,6 +89203,7 @@ exports.PreviewAttachProrationBehavior$outboundSchema = PreviewAttachProrationBe
89141
89203
  exports.PreviewAttachPurchaseLimit$outboundSchema = PreviewAttachPurchaseLimit$outboundSchema;
89142
89204
  exports.PreviewAttachRedirectMode = PreviewAttachRedirectMode;
89143
89205
  exports.PreviewAttachRedirectMode$outboundSchema = PreviewAttachRedirectMode$outboundSchema;
89206
+ exports.PreviewAttachRemoveDiscount$outboundSchema = PreviewAttachRemoveDiscount$outboundSchema;
89144
89207
  exports.PreviewAttachRemoveItemBillingMethod = PreviewAttachRemoveItemBillingMethod;
89145
89208
  exports.PreviewAttachRemoveItemBillingMethod$outboundSchema = PreviewAttachRemoveItemBillingMethod$outboundSchema;
89146
89209
  exports.PreviewAttachRemoveLicense$outboundSchema = PreviewAttachRemoveLicense$outboundSchema;
@@ -89969,6 +90032,7 @@ exports.SetupPaymentPriceUpsertLicenseInterval$outboundSchema = SetupPaymentPric
89969
90032
  exports.SetupPaymentProrationBehavior = SetupPaymentProrationBehavior;
89970
90033
  exports.SetupPaymentProrationBehavior$outboundSchema = SetupPaymentProrationBehavior$outboundSchema;
89971
90034
  exports.SetupPaymentPurchaseLimit$outboundSchema = SetupPaymentPurchaseLimit$outboundSchema;
90035
+ exports.SetupPaymentRemoveDiscount$outboundSchema = SetupPaymentRemoveDiscount$outboundSchema;
89972
90036
  exports.SetupPaymentRemoveItemBillingMethod = SetupPaymentRemoveItemBillingMethod;
89973
90037
  exports.SetupPaymentRemoveItemBillingMethod$outboundSchema = SetupPaymentRemoveItemBillingMethod$outboundSchema;
89974
90038
  exports.SetupPaymentRemoveLicense$outboundSchema = SetupPaymentRemoveLicense$outboundSchema;
@@ -91484,6 +91548,7 @@ exports.attachOverageAllowedToJSON = attachOverageAllowedToJSON;
91484
91548
  exports.attachParamsToJSON = attachParamsToJSON;
91485
91549
  exports.attachPlanItemFilterToJSON = attachPlanItemFilterToJSON;
91486
91550
  exports.attachPurchaseLimitToJSON = attachPurchaseLimitToJSON;
91551
+ exports.attachRemoveDiscountToJSON = attachRemoveDiscountToJSON;
91487
91552
  exports.attachRemoveLicenseToJSON = attachRemoveLicenseToJSON;
91488
91553
  exports.attachRequiredActionFromJSON = attachRequiredActionFromJSON;
91489
91554
  exports.attachResponseFromJSON = attachResponseFromJSON;
@@ -93663,6 +93728,7 @@ exports.previewAttachOverageAllowedToJSON = previewAttachOverageAllowedToJSON;
93663
93728
  exports.previewAttachParamsToJSON = previewAttachParamsToJSON;
93664
93729
  exports.previewAttachPlanItemFilterToJSON = previewAttachPlanItemFilterToJSON;
93665
93730
  exports.previewAttachPurchaseLimitToJSON = previewAttachPurchaseLimitToJSON;
93731
+ exports.previewAttachRemoveDiscountToJSON = previewAttachRemoveDiscountToJSON;
93666
93732
  exports.previewAttachRemoveLicenseToJSON = previewAttachRemoveLicenseToJSON;
93667
93733
  exports.previewAttachResponseFromJSON = previewAttachResponseFromJSON;
93668
93734
  exports.previewAttachSpendLimitToJSON = previewAttachSpendLimitToJSON;
@@ -94162,6 +94228,7 @@ exports.setupPaymentOverageAllowedToJSON = setupPaymentOverageAllowedToJSON;
94162
94228
  exports.setupPaymentParamsToJSON = setupPaymentParamsToJSON;
94163
94229
  exports.setupPaymentPlanItemFilterToJSON = setupPaymentPlanItemFilterToJSON;
94164
94230
  exports.setupPaymentPurchaseLimitToJSON = setupPaymentPurchaseLimitToJSON;
94231
+ exports.setupPaymentRemoveDiscountToJSON = setupPaymentRemoveDiscountToJSON;
94165
94232
  exports.setupPaymentRemoveLicenseToJSON = setupPaymentRemoveLicenseToJSON;
94166
94233
  exports.setupPaymentResponseFromJSON = setupPaymentResponseFromJSON;
94167
94234
  exports.setupPaymentSpendLimitToJSON = setupPaymentSpendLimitToJSON;