autumn-js 1.2.45 → 1.2.46

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 (134) hide show
  1. package/dist/backend/adapters/express.js +109 -23
  2. package/dist/backend/adapters/express.mjs +9 -9
  3. package/dist/backend/adapters/fetch.js +109 -23
  4. package/dist/backend/adapters/fetch.mjs +9 -9
  5. package/dist/backend/adapters/hono.js +109 -23
  6. package/dist/backend/adapters/hono.mjs +9 -9
  7. package/dist/backend/adapters/index.js +109 -23
  8. package/dist/backend/adapters/index.mjs +12 -12
  9. package/dist/backend/adapters/next.js +109 -23
  10. package/dist/backend/adapters/next.mjs +9 -9
  11. package/dist/backend/{chunk-L7N6FVEE.mjs → chunk-564D2O3W.mjs} +1 -1
  12. package/dist/backend/{chunk-DY6WMOCT.mjs → chunk-KW47VZ73.mjs} +5 -5
  13. package/dist/backend/{chunk-PVDDMLWT.mjs → chunk-RPUV2OZA.mjs} +91 -19
  14. package/dist/backend/{chunk-5DLBV5WP.mjs → chunk-SBZEXVB4.mjs} +7 -7
  15. package/dist/backend/{chunk-67LHAREL.mjs → chunk-TEDQUFQV.mjs} +1 -1
  16. package/dist/backend/{chunk-YKRFY5TK.mjs → chunk-UJS4Q7J4.mjs} +18 -4
  17. package/dist/backend/{chunk-P2TFPTAM.mjs → chunk-WR6ZPCQG.mjs} +1 -1
  18. package/dist/backend/{chunk-J2VZ3UZS.mjs → chunk-XOAX5KAL.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 +109 -23
  22. package/dist/backend/core/handlers/coreHandler.mjs +7 -7
  23. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  25. package/dist/backend/core/handlers/executeRoute.mjs +4 -4
  26. package/dist/backend/core/handlers/handleRouteByName.js +109 -23
  27. package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
  28. package/dist/backend/core/handlers/index.d.mts +1 -1
  29. package/dist/backend/core/handlers/index.d.ts +1 -1
  30. package/dist/backend/core/handlers/index.js +109 -23
  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 +109 -23
  35. package/dist/backend/core/index.mjs +10 -10
  36. package/dist/backend/core/routes/index.d.mts +1 -1
  37. package/dist/backend/core/routes/index.d.ts +1 -1
  38. package/dist/backend/core/routes/index.js +18 -4
  39. package/dist/backend/core/routes/index.mjs +2 -2
  40. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  41. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  43. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  44. package/dist/backend/core/routes/routeConfigs.js +18 -4
  45. package/dist/backend/core/routes/routeConfigs.mjs +2 -2
  46. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  47. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  48. package/dist/backend/core/types/index.d.mts +1 -1
  49. package/dist/backend/core/types/index.d.ts +1 -1
  50. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  51. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  52. package/dist/backend/core/utils/index.mjs +3 -3
  53. package/dist/backend/index.d.mts +2 -2
  54. package/dist/backend/index.d.ts +2 -2
  55. package/dist/backend/index.js +109 -23
  56. package/dist/backend/index.mjs +10 -10
  57. package/dist/backend/{routeTypes-UN48tvoc.d.mts → routeTypes-DnUY8ksp.d.mts} +121 -8
  58. package/dist/backend/{routeTypes-COLvwrcx.d.ts → routeTypes-TbN5QHEp.d.ts} +121 -8
  59. package/dist/better-auth/{chunk-MOCG3CBD.mjs → chunk-SABPXZTZ.mjs} +92 -20
  60. package/dist/better-auth/{chunk-3LKXO3EE.mjs → chunk-TOQRV6D7.mjs} +1 -1
  61. package/dist/better-auth/{chunk-J3W4EO5H.mjs → chunk-YRHQ4VL7.mjs} +18 -4
  62. package/dist/better-auth/index.js +109 -23
  63. package/dist/better-auth/index.mjs +3 -3
  64. package/dist/better-auth/utils/createAutumnEndpoint.js +18 -4
  65. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  66. package/dist/better-auth/utils/handleBetterAuthRoute.js +109 -23
  67. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  68. package/dist/better-auth/utils/index.js +109 -23
  69. package/dist/better-auth/utils/index.mjs +3 -3
  70. package/dist/react/AutumnContext.d.mts +1 -1
  71. package/dist/react/AutumnContext.d.ts +1 -1
  72. package/dist/react/AutumnProvider.js +1 -1
  73. package/dist/react/AutumnProvider.mjs +2 -2
  74. package/dist/react/{chunk-EE3XPYSL.mjs → chunk-2C6RX3EW.mjs} +1 -1
  75. package/dist/react/{chunk-SBCI4L22.mjs → chunk-2X7HXG2W.mjs} +1 -1
  76. package/dist/react/{chunk-7SRCZYRC.mjs → chunk-3WU4ZFXU.mjs} +1 -1
  77. package/dist/react/{chunk-LUBYNTYC.mjs → chunk-4HU5BGSM.mjs} +1 -1
  78. package/dist/react/{chunk-RTZAB46K.mjs → chunk-7RF3IGDO.mjs} +1 -1
  79. package/dist/react/{chunk-KCOHZSS3.mjs → chunk-C6I2RW56.mjs} +8 -8
  80. package/dist/react/{chunk-CQF3ER2L.mjs → chunk-NWF7OFFQ.mjs} +2 -2
  81. package/dist/react/{chunk-CSJHU3F2.mjs → chunk-SRSYG5ZV.mjs} +1 -1
  82. package/dist/react/{chunk-QUGX6XRQ.mjs → chunk-UNQZV3K5.mjs} +1 -1
  83. package/dist/react/client/AutumnClient.d.mts +1 -1
  84. package/dist/react/client/AutumnClient.d.ts +1 -1
  85. package/dist/react/client/IAutumnClient.d.mts +1 -1
  86. package/dist/react/client/IAutumnClient.d.ts +1 -1
  87. package/dist/react/client/index.d.mts +1 -1
  88. package/dist/react/client/index.d.ts +1 -1
  89. package/dist/react/hooks/index.d.mts +1 -1
  90. package/dist/react/hooks/index.d.ts +1 -1
  91. package/dist/react/hooks/index.js +7 -7
  92. package/dist/react/hooks/index.mjs +8 -8
  93. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
  94. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
  95. package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
  96. package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
  97. package/dist/react/hooks/internal/useCustomerActions.js +1 -1
  98. package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
  99. package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
  100. package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
  101. package/dist/react/hooks/useAggregateEvents.js +7 -7
  102. package/dist/react/hooks/useAggregateEvents.mjs +2 -2
  103. package/dist/react/hooks/useCustomer.d.mts +1 -1
  104. package/dist/react/hooks/useCustomer.d.ts +1 -1
  105. package/dist/react/hooks/useCustomer.js +7 -7
  106. package/dist/react/hooks/useCustomer.mjs +3 -3
  107. package/dist/react/hooks/useEntity.d.mts +1 -1
  108. package/dist/react/hooks/useEntity.d.ts +1 -1
  109. package/dist/react/hooks/useEntity.js +7 -7
  110. package/dist/react/hooks/useEntity.mjs +2 -2
  111. package/dist/react/hooks/useListEvents.d.mts +1 -1
  112. package/dist/react/hooks/useListEvents.d.ts +1 -1
  113. package/dist/react/hooks/useListEvents.js +7 -7
  114. package/dist/react/hooks/useListEvents.mjs +2 -2
  115. package/dist/react/hooks/useListPlans.d.mts +1 -1
  116. package/dist/react/hooks/useListPlans.d.ts +1 -1
  117. package/dist/react/hooks/useListPlans.js +7 -7
  118. package/dist/react/hooks/useListPlans.mjs +2 -2
  119. package/dist/react/hooks/useReferrals.d.mts +1 -1
  120. package/dist/react/hooks/useReferrals.d.ts +1 -1
  121. package/dist/react/hooks/useReferrals.js +7 -7
  122. package/dist/react/hooks/useReferrals.mjs +2 -2
  123. package/dist/react/index.d.mts +1 -1
  124. package/dist/react/index.d.ts +1 -1
  125. package/dist/react/index.js +7 -7
  126. package/dist/react/index.mjs +9 -9
  127. package/dist/react/{params-DlzWLPN2.d.mts → params-BrFcJdeO.d.mts} +50 -4
  128. package/dist/react/{params-ChMwkOJA.d.ts → params-BwHZca3H.d.ts} +50 -4
  129. package/dist/sdk/index.d.mts +151 -10
  130. package/dist/sdk/index.d.ts +151 -10
  131. package/dist/sdk/index.js +110 -21
  132. package/dist/sdk/index.mjs +99 -20
  133. package/package.json +1 -1
  134. package/dist/backend/{chunk-IXUCY7AU.mjs → chunk-MOHYGUMA.mjs} +3 -3
@@ -8485,6 +8485,15 @@ var CreateReferralCodeResponse$inboundSchema = z22.pipe(
8485
8485
 
8486
8486
  // ../sdk/src/models/create-schedule-op.ts
8487
8487
  import * as z23 from "zod/v4-mini";
8488
+ var CreateScheduleFreeTrialDurationType = {
8489
+ Day: "day",
8490
+ Month: "month",
8491
+ Year: "year"
8492
+ };
8493
+ var CreateScheduleOnEnd = {
8494
+ Bill: "bill",
8495
+ Revert: "revert"
8496
+ };
8488
8497
  var CreateScheduleRedirectMode = {
8489
8498
  Always: "always",
8490
8499
  IfRequired: "if_required",
@@ -8494,7 +8503,7 @@ var CreateScheduleBillingBehavior = {
8494
8503
  ProrateImmediately: "prorate_immediately",
8495
8504
  None: "none"
8496
8505
  };
8497
- var CreateScheduleDurationType2 = {
8506
+ var PhaseStartDurationType = {
8498
8507
  Month: "month",
8499
8508
  Year: "year"
8500
8509
  };
@@ -8652,6 +8661,27 @@ var CreateScheduleCode = {
8652
8661
  PaymentFailed: "payment_failed",
8653
8662
  PaymentProcessing: "payment_processing"
8654
8663
  };
8664
+ var CreateScheduleFreeTrialDurationType$outboundSchema = z23.enum(CreateScheduleFreeTrialDurationType);
8665
+ var CreateScheduleOnEnd$outboundSchema = z23.enum(CreateScheduleOnEnd);
8666
+ var CreateScheduleFreeTrialParams$outboundSchema = z23.pipe(
8667
+ z23.object({
8668
+ durationLength: z23.number(),
8669
+ durationType: z23._default(
8670
+ CreateScheduleFreeTrialDurationType$outboundSchema,
8671
+ "month"
8672
+ ),
8673
+ cardRequired: z23._default(z23.boolean(), true),
8674
+ onEnd: z23.optional(CreateScheduleOnEnd$outboundSchema)
8675
+ }),
8676
+ z23.transform((v) => {
8677
+ return remap(v, {
8678
+ durationLength: "duration_length",
8679
+ durationType: "duration_type",
8680
+ cardRequired: "card_required",
8681
+ onEnd: "on_end"
8682
+ });
8683
+ })
8684
+ );
8655
8685
  var CreateScheduleInvoiceMode$outboundSchema = z23.pipe(
8656
8686
  z23.object({
8657
8687
  enabled: z23.boolean(),
@@ -8683,10 +8713,10 @@ var CreateScheduleAttachDiscount$outboundSchema = z23.pipe(
8683
8713
  var CreateScheduleRedirectMode$outboundSchema = z23.enum(CreateScheduleRedirectMode);
8684
8714
  var CreateScheduleBillingBehavior$outboundSchema = z23.enum(CreateScheduleBillingBehavior);
8685
8715
  var StartsAt2$outboundSchema = smartUnion([z23.number(), z23.string()]);
8686
- var CreateScheduleDurationType2$outboundSchema = z23.enum(CreateScheduleDurationType2);
8716
+ var PhaseStartDurationType$outboundSchema = z23.enum(PhaseStartDurationType);
8687
8717
  var StartingAfter2$outboundSchema = z23.pipe(
8688
8718
  z23.object({
8689
- durationType: CreateScheduleDurationType2$outboundSchema,
8719
+ durationType: PhaseStartDurationType$outboundSchema,
8690
8720
  durationCount: z23.int()
8691
8721
  }),
8692
8722
  z23.transform((v) => {
@@ -9145,6 +9175,7 @@ var CreateScheduleCustomize2$outboundSchema = z23.pipe(
9145
9175
  var CreateSchedulePlan2$outboundSchema = z23.pipe(
9146
9176
  z23.object({
9147
9177
  planId: z23.string(),
9178
+ entityId: z23.optional(z23.nullable(z23.string())),
9148
9179
  featureQuantities: z23.optional(
9149
9180
  z23.array(z23.lazy(() => CreateScheduleFeatureQuantity2$outboundSchema))
9150
9181
  ),
@@ -9157,6 +9188,7 @@ var CreateSchedulePlan2$outboundSchema = z23.pipe(
9157
9188
  z23.transform((v) => {
9158
9189
  return remap(v, {
9159
9190
  planId: "plan_id",
9191
+ entityId: "entity_id",
9160
9192
  featureQuantities: "feature_quantities",
9161
9193
  subscriptionId: "subscription_id"
9162
9194
  });
@@ -9183,6 +9215,10 @@ var CreateScheduleParams$outboundSchema = z23.pipe(
9183
9215
  z23.object({
9184
9216
  customerId: z23.string(),
9185
9217
  entityId: z23.optional(z23.string()),
9218
+ freeTrial: z23.optional(
9219
+ z23.nullable(z23.lazy(() => CreateScheduleFreeTrialParams$outboundSchema))
9220
+ ),
9221
+ currency: z23.optional(z23.string()),
9186
9222
  invoiceMode: z23.optional(
9187
9223
  z23.lazy(() => CreateScheduleInvoiceMode$outboundSchema)
9188
9224
  ),
@@ -9198,19 +9234,22 @@ var CreateScheduleParams$outboundSchema = z23.pipe(
9198
9234
  billingBehavior: z23.optional(CreateScheduleBillingBehavior$outboundSchema),
9199
9235
  billingCycleAnchor: z23.optional(z23.literal("now")),
9200
9236
  enablePlanImmediately: z23.optional(z23.boolean()),
9237
+ preserveAddOns: z23.optional(z23.boolean()),
9201
9238
  phases: z23.array(z23.lazy(() => PhaseStart$outboundSchema))
9202
9239
  }),
9203
9240
  z23.transform((v) => {
9204
9241
  return remap(v, {
9205
9242
  customerId: "customer_id",
9206
9243
  entityId: "entity_id",
9244
+ freeTrial: "free_trial",
9207
9245
  invoiceMode: "invoice_mode",
9208
9246
  successUrl: "success_url",
9209
9247
  checkoutSessionParams: "checkout_session_params",
9210
9248
  redirectMode: "redirect_mode",
9211
9249
  billingBehavior: "billing_behavior",
9212
9250
  billingCycleAnchor: "billing_cycle_anchor",
9213
- enablePlanImmediately: "enable_plan_immediately"
9251
+ enablePlanImmediately: "enable_plan_immediately",
9252
+ preserveAddOns: "preserve_add_ons"
9214
9253
  });
9215
9254
  })
9216
9255
  );
@@ -14958,6 +14997,10 @@ var MultiAttachOnEnd = {
14958
14997
  Bill: "bill",
14959
14998
  Revert: "revert"
14960
14999
  };
15000
+ var MultiAttachBillingBehavior = {
15001
+ ProrateImmediately: "prorate_immediately",
15002
+ None: "none"
15003
+ };
14961
15004
  var MultiAttachRedirectMode = {
14962
15005
  Always: "always",
14963
15006
  IfRequired: "if_required",
@@ -15152,13 +15195,15 @@ var MultiAttachPlan$outboundSchema = z49.pipe(
15152
15195
  z49.array(z49.lazy(() => MultiAttachFeatureQuantity$outboundSchema))
15153
15196
  ),
15154
15197
  version: z49.optional(z49.number()),
15155
- subscriptionId: z49.optional(z49.string())
15198
+ subscriptionId: z49.optional(z49.string()),
15199
+ entityId: z49.optional(z49.nullable(z49.string()))
15156
15200
  }),
15157
15201
  z49.transform((v) => {
15158
15202
  return remap(v, {
15159
15203
  planId: "plan_id",
15160
15204
  featureQuantities: "feature_quantities",
15161
- subscriptionId: "subscription_id"
15205
+ subscriptionId: "subscription_id",
15206
+ entityId: "entity_id"
15162
15207
  });
15163
15208
  })
15164
15209
  );
@@ -15208,6 +15253,7 @@ var MultiAttachAttachDiscount$outboundSchema = z49.pipe(
15208
15253
  });
15209
15254
  })
15210
15255
  );
15256
+ var MultiAttachBillingBehavior$outboundSchema = z49.enum(MultiAttachBillingBehavior);
15211
15257
  var MultiAttachRedirectMode$outboundSchema = z49.enum(MultiAttachRedirectMode);
15212
15258
  var MultiAttachLimitType$outboundSchema = z49.enum(MultiAttachLimitType);
15213
15259
  var MultiAttachSpendLimit$outboundSchema = z49.pipe(
@@ -15323,6 +15369,7 @@ var MultiAttachParams$outboundSchema = z49.pipe(
15323
15369
  freeTrial: z49.optional(
15324
15370
  z49.nullable(z49.lazy(() => MultiAttachFreeTrialParams$outboundSchema))
15325
15371
  ),
15372
+ startsAt: z49.optional(z49.int()),
15326
15373
  currency: z49.optional(z49.string()),
15327
15374
  invoiceMode: z49.optional(
15328
15375
  z49.lazy(() => MultiAttachInvoiceMode$outboundSchema)
@@ -15330,6 +15377,7 @@ var MultiAttachParams$outboundSchema = z49.pipe(
15330
15377
  discounts: z49.optional(
15331
15378
  z49.array(z49.lazy(() => MultiAttachAttachDiscount$outboundSchema))
15332
15379
  ),
15380
+ billingBehavior: z49.optional(MultiAttachBillingBehavior$outboundSchema),
15333
15381
  successUrl: z49.optional(z49.string()),
15334
15382
  checkoutSessionParams: z49.optional(z49.record(z49.string(), z49.any())),
15335
15383
  redirectMode: z49._default(
@@ -15346,7 +15394,9 @@ var MultiAttachParams$outboundSchema = z49.pipe(
15346
15394
  customerId: "customer_id",
15347
15395
  entityId: "entity_id",
15348
15396
  freeTrial: "free_trial",
15397
+ startsAt: "starts_at",
15349
15398
  invoiceMode: "invoice_mode",
15399
+ billingBehavior: "billing_behavior",
15350
15400
  successUrl: "success_url",
15351
15401
  checkoutSessionParams: "checkout_session_params",
15352
15402
  redirectMode: "redirect_mode",
@@ -16931,6 +16981,10 @@ var PreviewMultiAttachOnEnd = {
16931
16981
  Bill: "bill",
16932
16982
  Revert: "revert"
16933
16983
  };
16984
+ var PreviewMultiAttachBillingBehavior = {
16985
+ ProrateImmediately: "prorate_immediately",
16986
+ None: "none"
16987
+ };
16934
16988
  var PreviewMultiAttachRedirectMode = {
16935
16989
  Always: "always",
16936
16990
  IfRequired: "if_required",
@@ -17141,13 +17195,15 @@ var PreviewMultiAttachPlan$outboundSchema = z53.pipe(
17141
17195
  )
17142
17196
  ),
17143
17197
  version: z53.optional(z53.number()),
17144
- subscriptionId: z53.optional(z53.string())
17198
+ subscriptionId: z53.optional(z53.string()),
17199
+ entityId: z53.optional(z53.nullable(z53.string()))
17145
17200
  }),
17146
17201
  z53.transform((v) => {
17147
17202
  return remap(v, {
17148
17203
  planId: "plan_id",
17149
17204
  featureQuantities: "feature_quantities",
17150
- subscriptionId: "subscription_id"
17205
+ subscriptionId: "subscription_id",
17206
+ entityId: "entity_id"
17151
17207
  });
17152
17208
  })
17153
17209
  );
@@ -17200,6 +17256,7 @@ var PreviewMultiAttachAttachDiscount$outboundSchema = z53.pipe(
17200
17256
  });
17201
17257
  })
17202
17258
  );
17259
+ var PreviewMultiAttachBillingBehavior$outboundSchema = z53.enum(PreviewMultiAttachBillingBehavior);
17203
17260
  var PreviewMultiAttachRedirectMode$outboundSchema = z53.enum(PreviewMultiAttachRedirectMode);
17204
17261
  var PreviewMultiAttachLimitType$outboundSchema = z53.enum(PreviewMultiAttachLimitType);
17205
17262
  var PreviewMultiAttachSpendLimit$outboundSchema = z53.pipe(
@@ -17317,6 +17374,7 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
17317
17374
  z53.lazy(() => PreviewMultiAttachFreeTrialParams$outboundSchema)
17318
17375
  )
17319
17376
  ),
17377
+ startsAt: z53.optional(z53.int()),
17320
17378
  currency: z53.optional(z53.string()),
17321
17379
  invoiceMode: z53.optional(
17322
17380
  z53.lazy(() => PreviewMultiAttachInvoiceMode$outboundSchema)
@@ -17324,6 +17382,9 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
17324
17382
  discounts: z53.optional(
17325
17383
  z53.array(z53.lazy(() => PreviewMultiAttachAttachDiscount$outboundSchema))
17326
17384
  ),
17385
+ billingBehavior: z53.optional(
17386
+ PreviewMultiAttachBillingBehavior$outboundSchema
17387
+ ),
17327
17388
  successUrl: z53.optional(z53.string()),
17328
17389
  checkoutSessionParams: z53.optional(z53.record(z53.string(), z53.any())),
17329
17390
  redirectMode: z53._default(
@@ -17342,7 +17403,9 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
17342
17403
  customerId: "customer_id",
17343
17404
  entityId: "entity_id",
17344
17405
  freeTrial: "free_trial",
17406
+ startsAt: "starts_at",
17345
17407
  invoiceMode: "invoice_mode",
17408
+ billingBehavior: "billing_behavior",
17346
17409
  successUrl: "success_url",
17347
17410
  checkoutSessionParams: "checkout_session_params",
17348
17411
  redirectMode: "redirect_mode",
@@ -24873,15 +24936,17 @@ var FailOpenHook = class {
24873
24936
  var DEFAULT_TIMEOUT_MS = 5e3;
24874
24937
  var AUTO_TIMEOUT_OPERATION_IDS = /* @__PURE__ */ new Set(["check", "track"]);
24875
24938
  var TimeoutFixHook = class {
24876
- beforeRequest(hookCtx, request) {
24877
- let timeoutMs = hookCtx.options.timeoutMs;
24878
- if ((!timeoutMs || timeoutMs <= 0) && AUTO_TIMEOUT_OPERATION_IDS.has(hookCtx.operationID))
24879
- timeoutMs = DEFAULT_TIMEOUT_MS;
24880
- if (!timeoutMs || timeoutMs <= 0) return request;
24881
- const signal = typeof AbortSignal.any === "function" ? AbortSignal.any([request.signal, AbortSignal.timeout(timeoutMs)]) : AbortSignal.timeout(timeoutMs);
24882
- return new Request(request, {
24883
- signal
24884
- });
24939
+ beforeCreateRequest(hookCtx, input) {
24940
+ if (input.options?.signal || !AUTO_TIMEOUT_OPERATION_IDS.has(hookCtx.operationID)) {
24941
+ return input;
24942
+ }
24943
+ return {
24944
+ ...input,
24945
+ options: {
24946
+ ...input.options,
24947
+ signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
24948
+ }
24949
+ };
24885
24950
  }
24886
24951
  };
24887
24952
 
@@ -24890,7 +24955,7 @@ function initHooks(hooks) {
24890
24955
  const failOpenHook = new FailOpenHook();
24891
24956
  const timeoutFixHook = new TimeoutFixHook();
24892
24957
  hooks.registerSDKInitHook(failOpenHook);
24893
- hooks.registerBeforeRequestHook(timeoutFixHook);
24958
+ hooks.registerBeforeCreateRequestHook(timeoutFixHook);
24894
24959
  hooks.registerAfterErrorHook(failOpenHook);
24895
24960
  }
24896
24961
 
@@ -26764,11 +26829,13 @@ var Billing = class extends ClientSDK {
26764
26829
  * @example
26765
26830
  * ```typescript
26766
26831
  * // Schedule a transition from a trial plan to a paid plan
26767
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785242875734,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786452475734,"plans":[{"planId":"pro_plan"}]}] });
26832
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785760797907,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786970397907,"plans":[{"planId":"pro_plan"}]}] });
26768
26833
  * ```
26769
26834
  *
26770
26835
  * @param customerId - The ID of the customer to create the schedule for.
26771
26836
  * @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
26837
+ * @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
26838
+ * @param currency - Currency used to bill the immediate phase. (optional)
26772
26839
  * @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
26773
26840
  * @param discounts - List of discounts to apply to the immediate phase. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
26774
26841
  * @param successUrl - URL to redirect to after successful checkout. (optional)
@@ -26777,6 +26844,7 @@ var Billing = class extends ClientSDK {
26777
26844
  * @param billingBehavior - Whether to prorate the immediate phase. 'none' skips proration charges and credits. (optional)
26778
26845
  * @param billingCycleAnchor - Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time. (optional)
26779
26846
  * @param enablePlanImmediately - If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed. (optional)
26847
+ * @param preserveAddOns - If true, active recurring add-ons in scopes represented by the phase plans are retained. (optional)
26780
26848
  * @param phases - Ordered phase definitions for the schedule.
26781
26849
  *
26782
26850
  * @returns A create-schedule response with the schedule ID, persisted phases, and any required payment or checkout URL.
@@ -26815,9 +26883,11 @@ var Billing = class extends ClientSDK {
26815
26883
  * @param entityId - The ID of the entity to attach the plans to. (optional)
26816
26884
  * @param plans - The list of plans to attach to the customer.
26817
26885
  * @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
26886
+ * @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
26818
26887
  * @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
26819
26888
  * @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
26820
26889
  * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
26890
+ * @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
26821
26891
  * @param successUrl - URL to redirect to after successful checkout. (optional)
26822
26892
  * @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
26823
26893
  * @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)
@@ -26898,9 +26968,11 @@ var Billing = class extends ClientSDK {
26898
26968
  * @param entityId - The ID of the entity to attach the plans to. (optional)
26899
26969
  * @param plans - The list of plans to attach to the customer.
26900
26970
  * @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
26971
+ * @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
26901
26972
  * @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
26902
26973
  * @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
26903
26974
  * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
26975
+ * @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
26904
26976
  * @param successUrl - URL to redirect to after successful checkout. (optional)
26905
26977
  * @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
26906
26978
  * @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)
@@ -1,15 +1,15 @@
1
+ import {
2
+ Autumn
3
+ } from "./chunk-RPUV2OZA.mjs";
4
+ import {
5
+ executeRoute
6
+ } from "./chunk-MOHYGUMA.mjs";
1
7
  import {
2
8
  buildRouter
3
9
  } from "./chunk-UAR3TMWI.mjs";
4
- import {
5
- Autumn
6
- } from "./chunk-PVDDMLWT.mjs";
7
10
  import {
8
11
  routeConfigs
9
- } from "./chunk-YKRFY5TK.mjs";
10
- import {
11
- executeRoute
12
- } from "./chunk-IXUCY7AU.mjs";
12
+ } from "./chunk-UJS4Q7J4.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-5DLBV5WP.mjs";
3
+ } from "./chunk-SBZEXVB4.mjs";
4
4
 
5
5
  // src/backend/adapters/hono.ts
6
6
  function autumnHandler(options) {
@@ -1613,7 +1613,8 @@ var multiAttachPlanOutboundSchema = z7.object({
1613
1613
  customize: z7.union([multiAttachCustomizeOutboundSchema, z7.undefined()]).optional(),
1614
1614
  feature_quantities: z7.union([z7.array(multiAttachFeatureQuantityOutboundSchema), z7.undefined()]).optional(),
1615
1615
  version: z7.union([z7.number(), z7.undefined()]).optional(),
1616
- subscription_id: z7.union([z7.string(), z7.undefined()]).optional()
1616
+ subscription_id: z7.union([z7.string(), z7.undefined()]).optional(),
1617
+ entity_id: z7.union([z7.string(), z7.undefined()]).optional().nullable()
1617
1618
  });
1618
1619
  var multiAttachFreeTrialParamsOutboundSchema = z7.object({
1619
1620
  duration_length: z7.number(),
@@ -1741,7 +1742,8 @@ var multiAttachPlanSchema = z7.object({
1741
1742
  customize: z7.union([multiAttachCustomizeSchema, z7.undefined()]).optional(),
1742
1743
  featureQuantities: z7.union([z7.array(multiAttachFeatureQuantitySchema), z7.undefined()]).optional(),
1743
1744
  version: z7.union([z7.number(), z7.undefined()]).optional(),
1744
- subscriptionId: z7.union([z7.string(), z7.undefined()]).optional()
1745
+ subscriptionId: z7.union([z7.string(), z7.undefined()]).optional(),
1746
+ entityId: z7.union([z7.string(), z7.undefined()]).optional().nullable()
1745
1747
  });
1746
1748
  var multiAttachDurationTypeSchema = closedEnumSchema4;
1747
1749
  var multiAttachOnEndSchema = closedEnumSchema4;
@@ -1751,6 +1753,7 @@ var multiAttachFreeTrialParamsSchema = z7.object({
1751
1753
  cardRequired: z7.union([z7.boolean(), z7.undefined()]).optional(),
1752
1754
  onEnd: z7.union([multiAttachOnEndSchema, z7.undefined()]).optional()
1753
1755
  });
1756
+ var multiAttachBillingBehaviorSchema = closedEnumSchema4;
1754
1757
  var multiAttachRedirectModeSchema = closedEnumSchema4;
1755
1758
  var multiAttachLimitTypeSchema = closedEnumSchema4;
1756
1759
  var multiAttachSpendLimitSchema = z7.object({
@@ -1792,9 +1795,11 @@ var multiAttachParamsSchema = z7.object({
1792
1795
  entityId: z7.union([z7.string(), z7.undefined()]).optional(),
1793
1796
  plans: z7.array(multiAttachPlanSchema),
1794
1797
  freeTrial: z7.union([multiAttachFreeTrialParamsSchema, z7.undefined()]).optional().nullable(),
1798
+ startsAt: z7.union([z7.number(), z7.undefined()]).optional(),
1795
1799
  currency: z7.union([z7.string(), z7.undefined()]).optional(),
1796
1800
  invoiceMode: z7.union([multiAttachInvoiceModeSchema, z7.undefined()]).optional(),
1797
1801
  discounts: z7.union([z7.array(multiAttachAttachDiscountSchema), z7.undefined()]).optional(),
1802
+ billingBehavior: z7.union([multiAttachBillingBehaviorSchema, z7.undefined()]).optional(),
1798
1803
  successUrl: z7.union([z7.string(), z7.undefined()]).optional(),
1799
1804
  checkoutSessionParams: z7.union([z7.record(z7.string(), z7.any()), z7.undefined()]).optional(),
1800
1805
  redirectMode: z7.union([multiAttachRedirectModeSchema, z7.undefined()]).optional(),
@@ -1820,9 +1825,11 @@ var multiAttachParamsOutboundSchema = z7.object({
1820
1825
  entity_id: z7.union([z7.string(), z7.undefined()]).optional(),
1821
1826
  plans: z7.array(multiAttachPlanOutboundSchema),
1822
1827
  free_trial: z7.union([multiAttachFreeTrialParamsOutboundSchema, z7.undefined()]).optional().nullable(),
1828
+ starts_at: z7.union([z7.number(), z7.undefined()]).optional(),
1823
1829
  currency: z7.union([z7.string(), z7.undefined()]).optional(),
1824
1830
  invoice_mode: z7.union([multiAttachInvoiceModeOutboundSchema, z7.undefined()]).optional(),
1825
1831
  discounts: z7.union([z7.array(multiAttachAttachDiscountOutboundSchema), z7.undefined()]).optional(),
1832
+ billing_behavior: z7.union([z7.string(), z7.undefined()]).optional(),
1826
1833
  success_url: z7.union([z7.string(), z7.undefined()]).optional(),
1827
1834
  checkout_session_params: z7.union([z7.record(z7.string(), z7.any()), z7.undefined()]).optional(),
1828
1835
  redirect_mode: z7.string(),
@@ -2968,7 +2975,8 @@ var previewMultiAttachPlanOutboundSchema = z10.object({
2968
2975
  z10.undefined()
2969
2976
  ]).optional(),
2970
2977
  version: z10.union([z10.number(), z10.undefined()]).optional(),
2971
- subscription_id: z10.union([z10.string(), z10.undefined()]).optional()
2978
+ subscription_id: z10.union([z10.string(), z10.undefined()]).optional(),
2979
+ entity_id: z10.union([z10.string(), z10.undefined()]).optional().nullable()
2972
2980
  });
2973
2981
  var previewMultiAttachFreeTrialParamsOutboundSchema = z10.object({
2974
2982
  duration_length: z10.number(),
@@ -3106,7 +3114,8 @@ var previewMultiAttachPlanSchema = z10.object({
3106
3114
  z10.undefined()
3107
3115
  ]).optional(),
3108
3116
  version: z10.union([z10.number(), z10.undefined()]).optional(),
3109
- subscriptionId: z10.union([z10.string(), z10.undefined()]).optional()
3117
+ subscriptionId: z10.union([z10.string(), z10.undefined()]).optional(),
3118
+ entityId: z10.union([z10.string(), z10.undefined()]).optional().nullable()
3110
3119
  });
3111
3120
  var previewMultiAttachDurationTypeSchema = closedEnumSchema6;
3112
3121
  var previewMultiAttachOnEndSchema = closedEnumSchema6;
@@ -3116,6 +3125,7 @@ var previewMultiAttachFreeTrialParamsSchema = z10.object({
3116
3125
  cardRequired: z10.union([z10.boolean(), z10.undefined()]).optional(),
3117
3126
  onEnd: z10.union([previewMultiAttachOnEndSchema, z10.undefined()]).optional()
3118
3127
  });
3128
+ var previewMultiAttachBillingBehaviorSchema = closedEnumSchema6;
3119
3129
  var previewMultiAttachRedirectModeSchema = closedEnumSchema6;
3120
3130
  var previewMultiAttachLimitTypeSchema = closedEnumSchema6;
3121
3131
  var previewMultiAttachSpendLimitSchema = z10.object({
@@ -3157,9 +3167,11 @@ var previewMultiAttachParamsSchema = z10.object({
3157
3167
  entityId: z10.union([z10.string(), z10.undefined()]).optional(),
3158
3168
  plans: z10.array(previewMultiAttachPlanSchema),
3159
3169
  freeTrial: z10.union([previewMultiAttachFreeTrialParamsSchema, z10.undefined()]).optional().nullable(),
3170
+ startsAt: z10.union([z10.number(), z10.undefined()]).optional(),
3160
3171
  currency: z10.union([z10.string(), z10.undefined()]).optional(),
3161
3172
  invoiceMode: z10.union([previewMultiAttachInvoiceModeSchema, z10.undefined()]).optional(),
3162
3173
  discounts: z10.union([z10.array(previewMultiAttachAttachDiscountSchema), z10.undefined()]).optional(),
3174
+ billingBehavior: z10.union([previewMultiAttachBillingBehaviorSchema, z10.undefined()]).optional(),
3163
3175
  successUrl: z10.union([z10.string(), z10.undefined()]).optional(),
3164
3176
  checkoutSessionParams: z10.union([z10.record(z10.string(), z10.any()), z10.undefined()]).optional(),
3165
3177
  redirectMode: z10.union([previewMultiAttachRedirectModeSchema, z10.undefined()]).optional(),
@@ -3213,12 +3225,14 @@ var previewMultiAttachParamsOutboundSchema = z10.object({
3213
3225
  entity_id: z10.union([z10.string(), z10.undefined()]).optional(),
3214
3226
  plans: z10.array(previewMultiAttachPlanOutboundSchema),
3215
3227
  free_trial: z10.union([previewMultiAttachFreeTrialParamsOutboundSchema, z10.undefined()]).optional().nullable(),
3228
+ starts_at: z10.union([z10.number(), z10.undefined()]).optional(),
3216
3229
  currency: z10.union([z10.string(), z10.undefined()]).optional(),
3217
3230
  invoice_mode: z10.union([previewMultiAttachInvoiceModeOutboundSchema, z10.undefined()]).optional(),
3218
3231
  discounts: z10.union([
3219
3232
  z10.array(previewMultiAttachAttachDiscountOutboundSchema),
3220
3233
  z10.undefined()
3221
3234
  ]).optional(),
3235
+ billing_behavior: z10.union([z10.string(), z10.undefined()]).optional(),
3222
3236
  success_url: z10.union([z10.string(), z10.undefined()]).optional(),
3223
3237
  checkout_session_params: z10.union([z10.record(z10.string(), z10.any()), z10.undefined()]).optional(),
3224
3238
  redirect_mode: z10.string(),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-5DLBV5WP.mjs";
3
+ } from "./chunk-SBZEXVB4.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-5DLBV5WP.mjs";
3
+ } from "./chunk-SBZEXVB4.mjs";
4
4
 
5
5
  // src/backend/adapters/express.ts
6
6
  function autumnHandler(options) {
@@ -1,6 +1,6 @@
1
1
  import { CoreHandlerOptions, UnifiedRequest, UnifiedResponse } from '../types/handlerTypes.mjs';
2
2
  import '../../authTypes-COW88tnI.mjs';
3
- import '../../routeTypes-UN48tvoc.mjs';
3
+ import '../../routeTypes-DnUY8ksp.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-COW88tnI.js';
3
- import '../../routeTypes-COLvwrcx.js';
3
+ import '../../routeTypes-TbN5QHEp.js';
4
4
  import 'zod/v4';
5
5
  import '../utils/sanitizeBody.js';
6
6
  import '../types/responseTypes.js';