autumn-js 1.2.11 → 1.2.13

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 (159) hide show
  1. package/dist/backend/adapters/express.js +143 -4
  2. package/dist/backend/adapters/express.mjs +8 -8
  3. package/dist/backend/adapters/fetch.js +143 -4
  4. package/dist/backend/adapters/fetch.mjs +8 -8
  5. package/dist/backend/adapters/hono.js +143 -4
  6. package/dist/backend/adapters/hono.mjs +8 -8
  7. package/dist/backend/adapters/index.js +143 -4
  8. package/dist/backend/adapters/index.mjs +11 -11
  9. package/dist/backend/adapters/next.js +143 -4
  10. package/dist/backend/adapters/next.mjs +8 -8
  11. package/dist/backend/{chunk-WMGBAAJK.mjs → chunk-7BVATYGA.mjs} +1 -1
  12. package/dist/backend/{chunk-4RBWBJIF.mjs → chunk-DNNJOZAT.mjs} +1 -1
  13. package/dist/backend/{chunk-SKWVW2EN.mjs → chunk-EJGHP7KT.mjs} +5 -5
  14. package/dist/backend/{chunk-FPZHAFCV.mjs → chunk-MANTLPDT.mjs} +24 -0
  15. package/dist/backend/{chunk-JEVAYQ65.mjs → chunk-OUDB34Y7.mjs} +1 -1
  16. package/dist/backend/{chunk-MBL56SEJ.mjs → chunk-RPH5L44S.mjs} +1 -1
  17. package/dist/backend/{chunk-AY6OV7CM.mjs → chunk-T42RZEUZ.mjs} +119 -4
  18. package/dist/backend/{chunk-JMDETKOQ.mjs → chunk-YSQQKZBU.mjs} +7 -7
  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 +143 -4
  22. package/dist/backend/core/handlers/coreHandler.mjs +6 -6
  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 +3 -3
  26. package/dist/backend/core/handlers/handleRouteByName.js +143 -4
  27. package/dist/backend/core/handlers/handleRouteByName.mjs +6 -6
  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 +143 -4
  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 +143 -4
  35. package/dist/backend/core/index.mjs +7 -7
  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 +24 -0
  39. package/dist/backend/core/routes/index.mjs +1 -1
  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 +24 -0
  45. package/dist/backend/core/routes/routeConfigs.mjs +1 -1
  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/index.d.mts +2 -2
  53. package/dist/backend/index.d.ts +2 -2
  54. package/dist/backend/index.js +143 -4
  55. package/dist/backend/index.mjs +7 -7
  56. package/dist/backend/{routeTypes-D7ANq7kY.d.ts → routeTypes-B94_Mq2J.d.ts} +129 -0
  57. package/dist/backend/{routeTypes-CQWFgZk4.d.mts → routeTypes-DVwngaBn.d.mts} +129 -0
  58. package/dist/better-auth/{chunk-3GVPOBXE.mjs → chunk-4OWECHZC.mjs} +1 -1
  59. package/dist/better-auth/{chunk-WEDJRTA3.mjs → chunk-JIFD4TSN.mjs} +24 -0
  60. package/dist/better-auth/{chunk-XH3WDFWS.mjs → chunk-ZZGFPTHO.mjs} +120 -5
  61. package/dist/better-auth/client.d.mts +3 -7
  62. package/dist/better-auth/client.d.ts +3 -7
  63. package/dist/better-auth/createAutumnEndpoint-CvXRCg-M.d.mts +43 -0
  64. package/dist/better-auth/createAutumnEndpoint-CvXRCg-M.d.ts +43 -0
  65. package/dist/better-auth/index.d.mts +3 -7
  66. package/dist/better-auth/index.d.ts +3 -7
  67. package/dist/better-auth/index.js +143 -4
  68. package/dist/better-auth/index.mjs +3 -3
  69. package/dist/better-auth/utils/createAutumnEndpoint.d.mts +3 -7
  70. package/dist/better-auth/utils/createAutumnEndpoint.d.ts +3 -7
  71. package/dist/better-auth/utils/createAutumnEndpoint.js +24 -0
  72. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  73. package/dist/better-auth/utils/handleBetterAuthRoute.d.mts +3 -7
  74. package/dist/better-auth/utils/handleBetterAuthRoute.d.ts +3 -7
  75. package/dist/better-auth/utils/handleBetterAuthRoute.js +143 -4
  76. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  77. package/dist/better-auth/utils/index.d.mts +3 -8
  78. package/dist/better-auth/utils/index.d.ts +3 -8
  79. package/dist/better-auth/utils/index.js +143 -4
  80. package/dist/better-auth/utils/index.mjs +3 -3
  81. package/dist/react/AutumnContext.d.mts +3 -3
  82. package/dist/react/AutumnContext.d.ts +3 -3
  83. package/dist/react/AutumnProvider.js +15 -15
  84. package/dist/react/AutumnProvider.mjs +2 -2
  85. package/dist/react/{chunk-26CKSAPZ.mjs → chunk-7IDH4OMG.mjs} +1 -1
  86. package/dist/react/{chunk-HSQUB3BZ.mjs → chunk-BDG6JHEW.mjs} +1 -1
  87. package/dist/react/{chunk-KB72KQKN.mjs → chunk-DEZBJQEG.mjs} +1 -1
  88. package/dist/react/{chunk-XJZH5NMZ.mjs → chunk-E5ZHOMZ4.mjs} +23 -23
  89. package/dist/react/{chunk-OXQG65ZT.mjs → chunk-FWWIAOPU.mjs} +1 -1
  90. package/dist/react/{chunk-ZGPE4R6H.mjs → chunk-HVBDZARN.mjs} +2 -2
  91. package/dist/react/{chunk-MC2YYATT.mjs → chunk-J6SLKTKE.mjs} +1 -1
  92. package/dist/react/{chunk-CHU7CIWP.mjs → chunk-NSFHAUTD.mjs} +1 -1
  93. package/dist/react/{chunk-G7FTQLT7.mjs → chunk-YQFYWH7J.mjs} +1 -1
  94. package/dist/react/client/AutumnClient.d.mts +3 -3
  95. package/dist/react/client/AutumnClient.d.ts +3 -3
  96. package/dist/react/client/IAutumnClient.d.mts +16 -3
  97. package/dist/react/client/IAutumnClient.d.ts +16 -3
  98. package/dist/react/client/index.d.mts +3 -3
  99. package/dist/react/client/index.d.ts +3 -3
  100. package/dist/react/{customer-CbcVyRCQ.d.ts → customer-CaGJEN5J.d.ts} +1 -1
  101. package/dist/react/{customer-BYYt9N1h.d.mts → customer-DB8vL_m7.d.mts} +1 -1
  102. package/dist/react/hooks/index.d.mts +3 -3
  103. package/dist/react/hooks/index.d.ts +3 -3
  104. package/dist/react/hooks/index.js +16 -16
  105. package/dist/react/hooks/index.mjs +8 -8
  106. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  107. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  108. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  109. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  110. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  111. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  112. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  113. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  114. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  115. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  116. package/dist/react/hooks/internal/useCustomerActions.d.mts +3 -3
  117. package/dist/react/hooks/internal/useCustomerActions.d.ts +3 -3
  118. package/dist/react/hooks/internal/useCustomerActions.js +1 -1
  119. package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
  120. package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
  121. package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
  122. package/dist/react/hooks/useAggregateEvents.js +16 -16
  123. package/dist/react/hooks/useAggregateEvents.mjs +2 -2
  124. package/dist/react/hooks/useCustomer.d.mts +3 -3
  125. package/dist/react/hooks/useCustomer.d.ts +3 -3
  126. package/dist/react/hooks/useCustomer.js +16 -16
  127. package/dist/react/hooks/useCustomer.mjs +3 -3
  128. package/dist/react/hooks/useEntity.d.mts +2 -2
  129. package/dist/react/hooks/useEntity.d.ts +2 -2
  130. package/dist/react/hooks/useEntity.js +16 -16
  131. package/dist/react/hooks/useEntity.mjs +2 -2
  132. package/dist/react/hooks/useListEvents.d.mts +2 -2
  133. package/dist/react/hooks/useListEvents.d.ts +2 -2
  134. package/dist/react/hooks/useListEvents.js +16 -16
  135. package/dist/react/hooks/useListEvents.mjs +2 -2
  136. package/dist/react/hooks/useListPlans.d.mts +2 -2
  137. package/dist/react/hooks/useListPlans.d.ts +2 -2
  138. package/dist/react/hooks/useListPlans.js +16 -16
  139. package/dist/react/hooks/useListPlans.mjs +2 -2
  140. package/dist/react/hooks/useReferrals.d.mts +2 -2
  141. package/dist/react/hooks/useReferrals.d.ts +2 -2
  142. package/dist/react/hooks/useReferrals.js +16 -16
  143. package/dist/react/hooks/useReferrals.mjs +2 -2
  144. package/dist/react/index.d.mts +3 -3
  145. package/dist/react/index.d.ts +3 -3
  146. package/dist/react/index.js +22 -22
  147. package/dist/react/index.mjs +9 -9
  148. package/dist/react/{params-5jUgYeHh.d.mts → params-B5l9vHfZ.d.ts} +35 -1
  149. package/dist/react/{params-g4jEwMY7.d.ts → params-BVglT8vT.d.mts} +35 -1
  150. package/dist/react/{plan-CqxFGNk2.d.mts → plan-DSTBzzTY.d.mts} +13 -0
  151. package/dist/react/{plan-CqxFGNk2.d.ts → plan-DSTBzzTY.d.ts} +13 -0
  152. package/dist/sdk/index.d.mts +179 -1
  153. package/dist/sdk/index.d.ts +179 -1
  154. package/dist/sdk/index.js +196 -4
  155. package/dist/sdk/index.mjs +179 -5
  156. package/package.json +1 -1
  157. package/dist/better-auth/createAutumnEndpoint-D9Plymvy.d.mts +0 -309
  158. package/dist/better-auth/createAutumnEndpoint-D9Plymvy.d.ts +0 -309
  159. package/dist/backend/{chunk-55C2WWXQ.mjs → chunk-S5HPMJ4U.mjs} +3 -3
@@ -8,7 +8,7 @@ import {
8
8
  routeConfigs,
9
9
  sanitizeBody,
10
10
  secretKeyCheck
11
- } from "./chunk-WEDJRTA3.mjs";
11
+ } from "./chunk-JIFD4TSN.mjs";
12
12
  import {
13
13
  getActiveOrganization
14
14
  } from "./chunk-BT3EAYVW.mjs";
@@ -2158,6 +2158,18 @@ var BillingUpdateInvoiceMode$outboundSchema = z12.pipe(
2158
2158
  );
2159
2159
  var BillingUpdateProrationBehavior$outboundSchema = z12.enum(BillingUpdateProrationBehavior);
2160
2160
  var BillingUpdateRedirectMode$outboundSchema = z12.enum(BillingUpdateRedirectMode);
2161
+ var BillingUpdateAttachDiscount$outboundSchema = z12.pipe(
2162
+ z12.object({
2163
+ rewardId: z12.optional(z12.string()),
2164
+ promotionCode: z12.optional(z12.string())
2165
+ }),
2166
+ z12.transform((v) => {
2167
+ return remap(v, {
2168
+ rewardId: "reward_id",
2169
+ promotionCode: "promotion_code"
2170
+ });
2171
+ })
2172
+ );
2161
2173
  var BillingUpdateCancelAction$outboundSchema = z12.enum(BillingUpdateCancelAction);
2162
2174
  var BillingUpdateRecalculateBalances$outboundSchema = z12.object({
2163
2175
  enabled: z12.boolean()
@@ -2183,6 +2195,9 @@ var UpdateSubscriptionParams$outboundSchema = z12.pipe(
2183
2195
  "if_required"
2184
2196
  ),
2185
2197
  subscriptionId: z12.optional(z12.string()),
2198
+ discounts: z12.optional(
2199
+ z12.array(z12.lazy(() => BillingUpdateAttachDiscount$outboundSchema))
2200
+ ),
2186
2201
  cancelAction: z12.optional(BillingUpdateCancelAction$outboundSchema),
2187
2202
  billingCycleAnchor: z12.optional(z12.literal("now")),
2188
2203
  noBillingChanges: z12.optional(z12.boolean()),
@@ -3046,6 +3061,16 @@ var FreeTrial$inboundSchema = z16.pipe(
3046
3061
  })
3047
3062
  );
3048
3063
  var PlanEnv$inboundSchema = inboundSchema(PlanEnv);
3064
+ var PlanConfig$inboundSchema = z16.pipe(
3065
+ z16.object({
3066
+ ignore_past_due: z16._default(boolean2(), false)
3067
+ }),
3068
+ z16.transform((v) => {
3069
+ return remap(v, {
3070
+ "ignore_past_due": "ignorePastDue"
3071
+ });
3072
+ })
3073
+ );
3049
3074
  var PlanStatus$inboundSchema = inboundSchema(PlanStatus);
3050
3075
  var AttachAction$inboundSchema = inboundSchema(AttachAction);
3051
3076
  var CustomerEligibility$inboundSchema = z16.pipe(
@@ -3079,6 +3104,7 @@ var Plan$inboundSchema = z16.pipe(
3079
3104
  env: PlanEnv$inboundSchema,
3080
3105
  archived: boolean2(),
3081
3106
  base_variant_id: nullable(string4()),
3107
+ config: z16.lazy(() => PlanConfig$inboundSchema),
3082
3108
  customer_eligibility: optional2(z16.lazy(
3083
3109
  () => CustomerEligibility$inboundSchema
3084
3110
  ))
@@ -3759,6 +3785,16 @@ var FreeTrialRequest$outboundSchema = z19.pipe(
3759
3785
  });
3760
3786
  })
3761
3787
  );
3788
+ var CreatePlanConfigRequest$outboundSchema = z19.pipe(
3789
+ z19.object({
3790
+ ignorePastDue: z19._default(z19.boolean(), false)
3791
+ }),
3792
+ z19.transform((v) => {
3793
+ return remap(v, {
3794
+ ignorePastDue: "ignore_past_due"
3795
+ });
3796
+ })
3797
+ );
3762
3798
  var CreatePlanParams$outboundSchema = z19.pipe(
3763
3799
  z19.object({
3764
3800
  planId: z19.string(),
@@ -3769,7 +3805,8 @@ var CreatePlanParams$outboundSchema = z19.pipe(
3769
3805
  autoEnable: z19._default(z19.boolean(), false),
3770
3806
  price: z19.optional(z19.lazy(() => CreatePlanPriceRequest$outboundSchema)),
3771
3807
  items: z19.optional(z19.array(z19.lazy(() => CreatePlanPlanItem$outboundSchema))),
3772
- freeTrial: z19.optional(z19.lazy(() => FreeTrialRequest$outboundSchema))
3808
+ freeTrial: z19.optional(z19.lazy(() => FreeTrialRequest$outboundSchema)),
3809
+ config: z19.optional(z19.lazy(() => CreatePlanConfigRequest$outboundSchema))
3773
3810
  }),
3774
3811
  z19.transform((v) => {
3775
3812
  return remap(v, {
@@ -3943,6 +3980,16 @@ var CreatePlanFreeTrialResponse$inboundSchema = z19.pipe(
3943
3980
  })
3944
3981
  );
3945
3982
  var CreatePlanEnv$inboundSchema = inboundSchema(CreatePlanEnv);
3983
+ var CreatePlanConfigResponse$inboundSchema = z19.pipe(
3984
+ z19.object({
3985
+ ignore_past_due: z19._default(boolean2(), false)
3986
+ }),
3987
+ z19.transform((v) => {
3988
+ return remap(v, {
3989
+ "ignore_past_due": "ignorePastDue"
3990
+ });
3991
+ })
3992
+ );
3946
3993
  var CreatePlanStatus$inboundSchema = inboundSchema(CreatePlanStatus);
3947
3994
  var CreatePlanAttachAction$inboundSchema = inboundSchema(CreatePlanAttachAction);
3948
3995
  var CreatePlanCustomerEligibility$inboundSchema = z19.pipe(
@@ -3978,6 +4025,7 @@ var CreatePlanResponse$inboundSchema = z19.pipe(
3978
4025
  env: CreatePlanEnv$inboundSchema,
3979
4026
  archived: boolean2(),
3980
4027
  base_variant_id: nullable(string4()),
4028
+ config: z19.lazy(() => CreatePlanConfigResponse$inboundSchema),
3981
4029
  customer_eligibility: optional2(
3982
4030
  z19.lazy(() => CreatePlanCustomerEligibility$inboundSchema)
3983
4031
  )
@@ -5230,6 +5278,16 @@ var GetPlanFreeTrial$inboundSchema = z31.pipe(
5230
5278
  })
5231
5279
  );
5232
5280
  var GetPlanEnv$inboundSchema = inboundSchema(GetPlanEnv);
5281
+ var GetPlanConfig$inboundSchema = z31.pipe(
5282
+ z31.object({
5283
+ ignore_past_due: z31._default(boolean2(), false)
5284
+ }),
5285
+ z31.transform((v) => {
5286
+ return remap(v, {
5287
+ "ignore_past_due": "ignorePastDue"
5288
+ });
5289
+ })
5290
+ );
5233
5291
  var GetPlanStatus$inboundSchema = inboundSchema(GetPlanStatus);
5234
5292
  var GetPlanAttachAction$inboundSchema = inboundSchema(GetPlanAttachAction);
5235
5293
  var GetPlanCustomerEligibility$inboundSchema = z31.pipe(
@@ -5263,6 +5321,7 @@ var GetPlanResponse$inboundSchema = z31.pipe(
5263
5321
  env: GetPlanEnv$inboundSchema,
5264
5322
  archived: boolean2(),
5265
5323
  base_variant_id: nullable(string4()),
5324
+ config: z31.lazy(() => GetPlanConfig$inboundSchema),
5266
5325
  customer_eligibility: optional2(
5267
5326
  z31.lazy(() => GetPlanCustomerEligibility$inboundSchema)
5268
5327
  )
@@ -5973,6 +6032,16 @@ var ListPlansFreeTrial$inboundSchema = z35.pipe(
5973
6032
  })
5974
6033
  );
5975
6034
  var ListPlansEnv$inboundSchema = inboundSchema(ListPlansEnv);
6035
+ var ListPlansConfig$inboundSchema = z35.pipe(
6036
+ z35.object({
6037
+ ignore_past_due: z35._default(boolean2(), false)
6038
+ }),
6039
+ z35.transform((v) => {
6040
+ return remap(v, {
6041
+ "ignore_past_due": "ignorePastDue"
6042
+ });
6043
+ })
6044
+ );
5976
6045
  var ListPlansStatus$inboundSchema = inboundSchema(ListPlansStatus);
5977
6046
  var ListPlansAttachAction$inboundSchema = inboundSchema(ListPlansAttachAction);
5978
6047
  var ListPlansCustomerEligibility$inboundSchema = z35.pipe(
@@ -6006,6 +6075,7 @@ var ListPlansList$inboundSchema = z35.pipe(
6006
6075
  env: ListPlansEnv$inboundSchema,
6007
6076
  archived: boolean2(),
6008
6077
  base_variant_id: nullable(string4()),
6078
+ config: z35.lazy(() => ListPlansConfig$inboundSchema),
6009
6079
  customer_eligibility: optional2(
6010
6080
  z35.lazy(() => ListPlansCustomerEligibility$inboundSchema)
6011
6081
  )
@@ -7894,6 +7964,18 @@ var PreviewUpdateInvoiceMode$outboundSchema = z40.pipe(
7894
7964
  );
7895
7965
  var PreviewUpdateProrationBehavior$outboundSchema = z40.enum(PreviewUpdateProrationBehavior);
7896
7966
  var PreviewUpdateRedirectMode$outboundSchema = z40.enum(PreviewUpdateRedirectMode);
7967
+ var PreviewUpdateAttachDiscount$outboundSchema = z40.pipe(
7968
+ z40.object({
7969
+ rewardId: z40.optional(z40.string()),
7970
+ promotionCode: z40.optional(z40.string())
7971
+ }),
7972
+ z40.transform((v) => {
7973
+ return remap(v, {
7974
+ rewardId: "reward_id",
7975
+ promotionCode: "promotion_code"
7976
+ });
7977
+ })
7978
+ );
7897
7979
  var PreviewUpdateCancelAction$outboundSchema = z40.enum(PreviewUpdateCancelAction);
7898
7980
  var PreviewUpdateRecalculateBalances$outboundSchema = z40.object({
7899
7981
  enabled: z40.boolean()
@@ -7919,6 +8001,9 @@ var PreviewUpdateParams$outboundSchema = z40.pipe(
7919
8001
  "if_required"
7920
8002
  ),
7921
8003
  subscriptionId: z40.optional(z40.string()),
8004
+ discounts: z40.optional(
8005
+ z40.array(z40.lazy(() => PreviewUpdateAttachDiscount$outboundSchema))
8006
+ ),
7922
8007
  cancelAction: z40.optional(PreviewUpdateCancelAction$outboundSchema),
7923
8008
  billingCycleAnchor: z40.optional(z40.literal("now")),
7924
8009
  noBillingChanges: z40.optional(z40.boolean()),
@@ -9685,6 +9770,16 @@ var UpdatePlanFreeTrialParams$outboundSchema = z48.pipe(
9685
9770
  });
9686
9771
  })
9687
9772
  );
9773
+ var UpdatePlanConfigRequest$outboundSchema = z48.pipe(
9774
+ z48.object({
9775
+ ignorePastDue: z48._default(z48.boolean(), false)
9776
+ }),
9777
+ z48.transform((v) => {
9778
+ return remap(v, {
9779
+ ignorePastDue: "ignore_past_due"
9780
+ });
9781
+ })
9782
+ );
9688
9783
  var UpdatePlanParams$outboundSchema = z48.pipe(
9689
9784
  z48.object({
9690
9785
  planId: z48.string(),
@@ -9700,6 +9795,7 @@ var UpdatePlanParams$outboundSchema = z48.pipe(
9700
9795
  freeTrial: z48.optional(
9701
9796
  z48.nullable(z48.lazy(() => UpdatePlanFreeTrialParams$outboundSchema))
9702
9797
  ),
9798
+ config: z48.optional(z48.lazy(() => UpdatePlanConfigRequest$outboundSchema)),
9703
9799
  version: z48.optional(z48.number()),
9704
9800
  archived: z48._default(z48.boolean(), false),
9705
9801
  newPlanId: z48.optional(z48.string())
@@ -9877,6 +9973,16 @@ var UpdatePlanFreeTrial$inboundSchema = z48.pipe(
9877
9973
  })
9878
9974
  );
9879
9975
  var UpdatePlanEnv$inboundSchema = inboundSchema(UpdatePlanEnv);
9976
+ var UpdatePlanConfigResponse$inboundSchema = z48.pipe(
9977
+ z48.object({
9978
+ ignore_past_due: z48._default(boolean2(), false)
9979
+ }),
9980
+ z48.transform((v) => {
9981
+ return remap(v, {
9982
+ "ignore_past_due": "ignorePastDue"
9983
+ });
9984
+ })
9985
+ );
9880
9986
  var UpdatePlanStatus$inboundSchema = inboundSchema(UpdatePlanStatus);
9881
9987
  var UpdatePlanAttachAction$inboundSchema = inboundSchema(UpdatePlanAttachAction);
9882
9988
  var UpdatePlanCustomerEligibility$inboundSchema = z48.pipe(
@@ -9910,6 +10016,7 @@ var UpdatePlanResponse$inboundSchema = z48.pipe(
9910
10016
  env: UpdatePlanEnv$inboundSchema,
9911
10017
  archived: boolean2(),
9912
10018
  base_variant_id: nullable(string4()),
10019
+ config: z48.lazy(() => UpdatePlanConfigResponse$inboundSchema),
9913
10020
  customer_eligibility: optional2(
9914
10021
  z48.lazy(() => UpdatePlanCustomerEligibility$inboundSchema)
9915
10022
  )
@@ -10168,10 +10275,14 @@ var FailOpenHook = class {
10168
10275
  fetcher: async (input, init) => {
10169
10276
  try {
10170
10277
  return init == null ? await fetch(input) : await fetch(input, init);
10171
- } catch {
10278
+ } catch (error) {
10279
+ console.log(error);
10280
+ console.log(
10281
+ `Network failed to reach Autumn: ${error}. Returning 555 Network Error.`
10282
+ );
10172
10283
  return new Response(null, {
10173
- status: 503,
10174
- statusText: "Autumn Unreachable"
10284
+ status: 555,
10285
+ statusText: "Network Error"
10175
10286
  });
10176
10287
  }
10177
10288
  }
@@ -11895,6 +12006,7 @@ var Billing = class extends ClientSDK {
11895
12006
  * @param prorationBehavior - How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges. (optional)
11896
12007
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
11897
12008
  * @param subscriptionId - A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan. (optional)
12009
+ * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
11898
12010
  * @param cancelAction - Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation. (optional)
11899
12011
  * @param billingCycleAnchor - Reset the billing cycle anchor immediately with 'now' (optional)
11900
12012
  * @param noBillingChanges - If true, the subscription is updated internally without applying billing changes in Stripe. (optional)
@@ -11930,6 +12042,7 @@ var Billing = class extends ClientSDK {
11930
12042
  * @param prorationBehavior - How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges. (optional)
11931
12043
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
11932
12044
  * @param subscriptionId - A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan. (optional)
12045
+ * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
11933
12046
  * @param cancelAction - Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation. (optional)
11934
12047
  * @param billingCycleAnchor - Reset the billing cycle anchor immediately with 'now' (optional)
11935
12048
  * @param noBillingChanges - If true, the subscription is updated internally without applying billing changes in Stripe. (optional)
@@ -13931,6 +14044,7 @@ var Plans = class extends ClientSDK {
13931
14044
  * @param price - Base recurring price for the plan. Omit for free or usage-only plans. (optional)
13932
14045
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
13933
14046
  * @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
14047
+ * @param config - Miscellaneous plan-level configuration flags. (optional)
13934
14048
  *
13935
14049
  * @returns The created plan object.
13936
14050
  */
@@ -14036,6 +14150,7 @@ var Plans = class extends ClientSDK {
14036
14150
  * @param price - The price of the plan. Set to null to remove the base price. (optional)
14037
14151
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
14038
14152
  * @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
14153
+ * @param config - Miscellaneous plan-level configuration flags. (optional)
14039
14154
  * @param newPlanId - The new ID to use for the plan. Can only be updated if the plan has not been used by any customers. (optional)
14040
14155
  *
14041
14156
  * @returns The updated plan object.
@@ -1,11 +1,7 @@
1
1
  import { autumn } from './index.mjs';
2
- import './createAutumnEndpoint-D9Plymvy.mjs';
3
- import './standard-schema.mjs';
4
- import './error.mjs';
5
- import './context.mjs';
6
- import './middleware.mjs';
7
- import './openapi.mjs';
8
- import 'zod';
2
+ import './createAutumnEndpoint-CvXRCg-M.mjs';
3
+ import '../../../../../node_modules/better-call/dist/endpoint.mjs';
4
+ import 'zod/v4';
9
5
  import 'zod/v4/core';
10
6
  import './types.mjs';
11
7
 
@@ -1,11 +1,7 @@
1
1
  import { autumn } from './index.js';
2
- import './createAutumnEndpoint-D9Plymvy.js';
3
- import './standard-schema.mjs';
4
- import './error.mjs';
5
- import './context.mjs';
6
- import './middleware.mjs';
7
- import './openapi.mjs';
8
- import 'zod';
2
+ import './createAutumnEndpoint-CvXRCg-M.js';
3
+ import '../../../../../node_modules/better-call/dist/endpoint.mjs';
4
+ import 'zod/v4';
9
5
  import 'zod/v4/core';
10
6
  import './types.js';
11
7
 
@@ -0,0 +1,43 @@
1
+ import * as _______________node_modules_better_call_dist_endpoint_mjs from '../../../../../node_modules/better-call/dist/endpoint.mjs';
2
+ import * as zod_v4 from 'zod/v4';
3
+ import * as z from 'zod/v4/core';
4
+
5
+ /** All supported route names as const for type safety */
6
+ declare const ROUTE_NAMES: {
7
+ readonly getOrCreateCustomer: "getOrCreateCustomer";
8
+ readonly getEntity: "getEntity";
9
+ readonly attach: "attach";
10
+ readonly previewAttach: "previewAttach";
11
+ readonly updateSubscription: "updateSubscription";
12
+ readonly previewUpdateSubscription: "previewUpdateSubscription";
13
+ readonly openCustomerPortal: "openCustomerPortal";
14
+ readonly createReferralCode: "createReferralCode";
15
+ readonly redeemReferralCode: "redeemReferralCode";
16
+ readonly listPlans: "listPlans";
17
+ readonly listEvents: "listEvents";
18
+ readonly aggregateEvents: "aggregateEvents";
19
+ readonly multiAttach: "multiAttach";
20
+ readonly previewMultiAttach: "previewMultiAttach";
21
+ readonly setupPayment: "setupPayment";
22
+ };
23
+ /** Union of all route names */
24
+ type RouteName = keyof typeof ROUTE_NAMES;
25
+
26
+ /** Type for the handleRoute function used by better-auth endpoints */
27
+ type HandleBetterAuthRouteFn = (args: {
28
+ ctx: unknown;
29
+ routeName: RouteName;
30
+ }) => Promise<{
31
+ status: number;
32
+ body: unknown;
33
+ }>;
34
+ /**
35
+ * Creates a better-auth endpoint for a given route name.
36
+ * Each route needs its own call to preserve TypeScript literal types for the path.
37
+ */
38
+ declare const createAutumnEndpoint: <T extends RouteName>(routeName: T, handleRoute: HandleBetterAuthRouteFn) => _______________node_modules_better_call_dist_endpoint_mjs.StrictEndpoint<`/autumn/${T}`, {
39
+ method: "POST";
40
+ body: zod_v4.ZodType<unknown, unknown, z.$ZodTypeInternals<unknown, unknown>> | undefined;
41
+ }, Record<string, unknown> | null>;
42
+
43
+ export { type HandleBetterAuthRouteFn as H, type RouteName as R, createAutumnEndpoint as c };
@@ -0,0 +1,43 @@
1
+ import * as _______________node_modules_better_call_dist_endpoint_mjs from '../../../../../node_modules/better-call/dist/endpoint.mjs';
2
+ import * as zod_v4 from 'zod/v4';
3
+ import * as z from 'zod/v4/core';
4
+
5
+ /** All supported route names as const for type safety */
6
+ declare const ROUTE_NAMES: {
7
+ readonly getOrCreateCustomer: "getOrCreateCustomer";
8
+ readonly getEntity: "getEntity";
9
+ readonly attach: "attach";
10
+ readonly previewAttach: "previewAttach";
11
+ readonly updateSubscription: "updateSubscription";
12
+ readonly previewUpdateSubscription: "previewUpdateSubscription";
13
+ readonly openCustomerPortal: "openCustomerPortal";
14
+ readonly createReferralCode: "createReferralCode";
15
+ readonly redeemReferralCode: "redeemReferralCode";
16
+ readonly listPlans: "listPlans";
17
+ readonly listEvents: "listEvents";
18
+ readonly aggregateEvents: "aggregateEvents";
19
+ readonly multiAttach: "multiAttach";
20
+ readonly previewMultiAttach: "previewMultiAttach";
21
+ readonly setupPayment: "setupPayment";
22
+ };
23
+ /** Union of all route names */
24
+ type RouteName = keyof typeof ROUTE_NAMES;
25
+
26
+ /** Type for the handleRoute function used by better-auth endpoints */
27
+ type HandleBetterAuthRouteFn = (args: {
28
+ ctx: unknown;
29
+ routeName: RouteName;
30
+ }) => Promise<{
31
+ status: number;
32
+ body: unknown;
33
+ }>;
34
+ /**
35
+ * Creates a better-auth endpoint for a given route name.
36
+ * Each route needs its own call to preserve TypeScript literal types for the path.
37
+ */
38
+ declare const createAutumnEndpoint: <T extends RouteName>(routeName: T, handleRoute: HandleBetterAuthRouteFn) => _______________node_modules_better_call_dist_endpoint_mjs.StrictEndpoint<`/autumn/${T}`, {
39
+ method: "POST";
40
+ body: zod_v4.ZodType<unknown, unknown, z.$ZodTypeInternals<unknown, unknown>> | undefined;
41
+ }, Record<string, unknown> | null>;
42
+
43
+ export { type HandleBetterAuthRouteFn as H, type RouteName as R, createAutumnEndpoint as c };
@@ -1,11 +1,7 @@
1
- import { R as RouteName, c as createAutumnEndpoint } from './createAutumnEndpoint-D9Plymvy.mjs';
1
+ import { R as RouteName, c as createAutumnEndpoint } from './createAutumnEndpoint-CvXRCg-M.mjs';
2
2
  import { AutumnOptions } from './types.mjs';
3
- import './standard-schema.mjs';
4
- import './error.mjs';
5
- import './context.mjs';
6
- import './middleware.mjs';
7
- import './openapi.mjs';
8
- import 'zod';
3
+ import '../../../../../node_modules/better-call/dist/endpoint.mjs';
4
+ import 'zod/v4';
9
5
  import 'zod/v4/core';
10
6
 
11
7
  /** Type for a single autumn endpoint */
@@ -1,11 +1,7 @@
1
- import { R as RouteName, c as createAutumnEndpoint } from './createAutumnEndpoint-D9Plymvy.js';
1
+ import { R as RouteName, c as createAutumnEndpoint } from './createAutumnEndpoint-CvXRCg-M.js';
2
2
  import { AutumnOptions } from './types.js';
3
- import './standard-schema.mjs';
4
- import './error.mjs';
5
- import './context.mjs';
6
- import './middleware.mjs';
7
- import './openapi.mjs';
8
- import 'zod';
3
+ import '../../../../../node_modules/better-call/dist/endpoint.mjs';
4
+ import 'zod/v4';
9
5
  import 'zod/v4/core';
10
6
 
11
7
  /** Type for a single autumn endpoint */