autumn-js 1.2.13 → 1.2.14

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 (109) hide show
  1. package/dist/backend/adapters/express.js +419 -69
  2. package/dist/backend/adapters/express.mjs +5 -5
  3. package/dist/backend/adapters/fetch.js +419 -69
  4. package/dist/backend/adapters/fetch.mjs +5 -5
  5. package/dist/backend/adapters/hono.js +419 -69
  6. package/dist/backend/adapters/hono.mjs +5 -5
  7. package/dist/backend/adapters/index.js +419 -69
  8. package/dist/backend/adapters/index.mjs +8 -8
  9. package/dist/backend/adapters/next.js +419 -69
  10. package/dist/backend/adapters/next.mjs +5 -5
  11. package/dist/backend/{chunk-YSQQKZBU.mjs → chunk-5XWZK7Q6.mjs} +1 -1
  12. package/dist/backend/{chunk-OUDB34Y7.mjs → chunk-BVJU43R5.mjs} +1 -1
  13. package/dist/backend/{chunk-T42RZEUZ.mjs → chunk-GE5VY4YO.mjs} +419 -69
  14. package/dist/backend/{chunk-DNNJOZAT.mjs → chunk-JDJMZQCY.mjs} +1 -1
  15. package/dist/backend/{chunk-7BVATYGA.mjs → chunk-N2OJ347N.mjs} +1 -1
  16. package/dist/backend/{chunk-EJGHP7KT.mjs → chunk-QAFNIIBW.mjs} +1 -1
  17. package/dist/backend/{chunk-RPH5L44S.mjs → chunk-ZOOAE7OJ.mjs} +1 -1
  18. package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
  19. package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
  20. package/dist/backend/core/handlers/coreHandler.js +419 -69
  21. package/dist/backend/core/handlers/coreHandler.mjs +3 -3
  22. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  23. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.mjs +1 -1
  25. package/dist/backend/core/handlers/handleRouteByName.js +419 -69
  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 +419 -69
  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 +419 -69
  34. package/dist/backend/core/index.mjs +6 -6
  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.mjs +1 -1
  38. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  39. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  40. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  41. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.mjs +1 -1
  43. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  44. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  45. package/dist/backend/core/types/index.d.mts +1 -1
  46. package/dist/backend/core/types/index.d.ts +1 -1
  47. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  48. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  49. package/dist/backend/core/utils/index.mjs +3 -3
  50. package/dist/backend/index.d.mts +2 -2
  51. package/dist/backend/index.d.ts +2 -2
  52. package/dist/backend/index.js +419 -69
  53. package/dist/backend/index.mjs +6 -6
  54. package/dist/backend/{routeTypes-DVwngaBn.d.mts → routeTypes-B-X-zb1q.d.mts} +558 -68
  55. package/dist/backend/{routeTypes-B94_Mq2J.d.ts → routeTypes-bGaZQm24.d.ts} +558 -68
  56. package/dist/better-auth/{chunk-ZZGFPTHO.mjs → chunk-DNNKTBFL.mjs} +419 -69
  57. package/dist/better-auth/client.d.mts +2 -4
  58. package/dist/better-auth/client.d.ts +2 -4
  59. package/dist/better-auth/{createAutumnEndpoint-CvXRCg-M.d.mts → createAutumnEndpoint-Clm1sxhQ.d.mts} +4 -8
  60. package/dist/better-auth/{createAutumnEndpoint-CvXRCg-M.d.ts → createAutumnEndpoint-Clm1sxhQ.d.ts} +4 -8
  61. package/dist/better-auth/index.d.mts +2 -4
  62. package/dist/better-auth/index.d.ts +2 -4
  63. package/dist/better-auth/index.js +419 -69
  64. package/dist/better-auth/index.mjs +1 -1
  65. package/dist/better-auth/utils/createAutumnEndpoint.d.mts +2 -4
  66. package/dist/better-auth/utils/createAutumnEndpoint.d.ts +2 -4
  67. package/dist/better-auth/utils/handleBetterAuthRoute.d.mts +2 -4
  68. package/dist/better-auth/utils/handleBetterAuthRoute.d.ts +2 -4
  69. package/dist/better-auth/utils/handleBetterAuthRoute.js +419 -69
  70. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +1 -1
  71. package/dist/better-auth/utils/index.d.mts +3 -4
  72. package/dist/better-auth/utils/index.d.ts +3 -4
  73. package/dist/better-auth/utils/index.js +419 -69
  74. package/dist/better-auth/utils/index.mjs +1 -1
  75. package/dist/react/AutumnContext.d.mts +1 -1
  76. package/dist/react/AutumnContext.d.ts +1 -1
  77. package/dist/react/client/AutumnClient.d.mts +1 -1
  78. package/dist/react/client/AutumnClient.d.ts +1 -1
  79. package/dist/react/client/IAutumnClient.d.mts +1 -1
  80. package/dist/react/client/IAutumnClient.d.ts +1 -1
  81. package/dist/react/client/index.d.mts +1 -1
  82. package/dist/react/client/index.d.ts +1 -1
  83. package/dist/react/hooks/index.d.mts +1 -1
  84. package/dist/react/hooks/index.d.ts +1 -1
  85. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
  86. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
  87. package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
  88. package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
  89. package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
  90. package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
  91. package/dist/react/hooks/useCustomer.d.mts +1 -1
  92. package/dist/react/hooks/useCustomer.d.ts +1 -1
  93. package/dist/react/hooks/useEntity.d.mts +1 -1
  94. package/dist/react/hooks/useEntity.d.ts +1 -1
  95. package/dist/react/hooks/useListEvents.d.mts +1 -1
  96. package/dist/react/hooks/useListEvents.d.ts +1 -1
  97. package/dist/react/hooks/useListPlans.d.mts +1 -1
  98. package/dist/react/hooks/useListPlans.d.ts +1 -1
  99. package/dist/react/hooks/useReferrals.d.mts +1 -1
  100. package/dist/react/hooks/useReferrals.d.ts +1 -1
  101. package/dist/react/index.d.mts +1 -1
  102. package/dist/react/index.d.ts +1 -1
  103. package/dist/react/{params-B5l9vHfZ.d.ts → params-CTiHT2EX.d.ts} +515 -64
  104. package/dist/react/{params-BVglT8vT.d.mts → params-ZvrBzzFE.d.mts} +515 -64
  105. package/dist/sdk/index.d.mts +683 -109
  106. package/dist/sdk/index.d.ts +683 -109
  107. package/dist/sdk/index.js +3436 -2889
  108. package/dist/sdk/index.mjs +3320 -2837
  109. package/package.json +1 -1
@@ -4878,31 +4878,31 @@ var BillingUpdateResponse$inboundSchema = z28.pipe(
4878
4878
 
4879
4879
  // ../sdk/src/models/check-op.ts
4880
4880
  var z29 = __toESM(require("zod/v4-mini"), 1);
4881
- var FlagType = {
4881
+ var FlagType2 = {
4882
4882
  Boolean: "boolean",
4883
4883
  Metered: "metered",
4884
4884
  CreditSystem: "credit_system"
4885
4885
  };
4886
- var Scenario = {
4886
+ var Scenario2 = {
4887
4887
  UsageLimit: "usage_limit",
4888
4888
  FeatureFlag: "feature_flag"
4889
4889
  };
4890
- var CheckEnv = {
4890
+ var CheckEnv2 = {
4891
4891
  Sandbox: "sandbox",
4892
4892
  Live: "live"
4893
4893
  };
4894
- var ProductType = {
4894
+ var ProductType2 = {
4895
4895
  Feature: "feature",
4896
4896
  PricedFeature: "priced_feature",
4897
4897
  Price: "price"
4898
4898
  };
4899
- var FeatureType = {
4899
+ var FeatureType2 = {
4900
4900
  SingleUse: "single_use",
4901
4901
  ContinuousUse: "continuous_use",
4902
4902
  Boolean: "boolean",
4903
4903
  Static: "static"
4904
4904
  };
4905
- var CheckInterval = {
4905
+ var CheckInterval2 = {
4906
4906
  Minute: "minute",
4907
4907
  Hour: "hour",
4908
4908
  Day: "day",
@@ -4912,37 +4912,113 @@ var CheckInterval = {
4912
4912
  SemiAnnual: "semi_annual",
4913
4913
  Year: "year"
4914
4914
  };
4915
- var CheckTierBehavior = {
4915
+ var CheckTierBehavior2 = {
4916
4916
  Graduated: "graduated",
4917
4917
  Volume: "volume"
4918
4918
  };
4919
- var UsageModel = {
4919
+ var UsageModel2 = {
4920
4920
  Prepaid: "prepaid",
4921
4921
  PayPerUse: "pay_per_use"
4922
4922
  };
4923
- var ConfigDuration = {
4923
+ var ConfigDuration2 = {
4924
4924
  Month: "month",
4925
4925
  Forever: "forever"
4926
4926
  };
4927
- var CheckOnIncrease = {
4927
+ var CheckOnIncrease2 = {
4928
4928
  BillImmediately: "bill_immediately",
4929
4929
  ProrateImmediately: "prorate_immediately",
4930
4930
  ProrateNextCycle: "prorate_next_cycle",
4931
4931
  BillNextCycle: "bill_next_cycle"
4932
4932
  };
4933
- var CheckOnDecrease = {
4933
+ var CheckOnDecrease2 = {
4934
4934
  Prorate: "prorate",
4935
4935
  ProrateImmediately: "prorate_immediately",
4936
4936
  ProrateNextCycle: "prorate_next_cycle",
4937
4937
  None: "none",
4938
4938
  NoProrations: "no_prorations"
4939
4939
  };
4940
- var FreeTrialDuration = {
4940
+ var FreeTrialDuration2 = {
4941
4941
  Day: "day",
4942
4942
  Month: "month",
4943
4943
  Year: "year"
4944
4944
  };
4945
- var ProductScenario = {
4945
+ var ProductScenario2 = {
4946
+ Scheduled: "scheduled",
4947
+ Active: "active",
4948
+ New: "new",
4949
+ Renew: "renew",
4950
+ Upgrade: "upgrade",
4951
+ UpdatePrepaidQuantity: "update_prepaid_quantity",
4952
+ Downgrade: "downgrade",
4953
+ Cancel: "cancel",
4954
+ Expired: "expired",
4955
+ PastDue: "past_due"
4956
+ };
4957
+ var FlagType1 = {
4958
+ Boolean: "boolean",
4959
+ Metered: "metered",
4960
+ CreditSystem: "credit_system"
4961
+ };
4962
+ var Scenario1 = {
4963
+ UsageLimit: "usage_limit",
4964
+ FeatureFlag: "feature_flag"
4965
+ };
4966
+ var CheckEnv1 = {
4967
+ Sandbox: "sandbox",
4968
+ Live: "live"
4969
+ };
4970
+ var ProductType1 = {
4971
+ Feature: "feature",
4972
+ PricedFeature: "priced_feature",
4973
+ Price: "price"
4974
+ };
4975
+ var FeatureType1 = {
4976
+ SingleUse: "single_use",
4977
+ ContinuousUse: "continuous_use",
4978
+ Boolean: "boolean",
4979
+ Static: "static"
4980
+ };
4981
+ var CheckInterval1 = {
4982
+ Minute: "minute",
4983
+ Hour: "hour",
4984
+ Day: "day",
4985
+ Week: "week",
4986
+ Month: "month",
4987
+ Quarter: "quarter",
4988
+ SemiAnnual: "semi_annual",
4989
+ Year: "year"
4990
+ };
4991
+ var CheckTierBehavior1 = {
4992
+ Graduated: "graduated",
4993
+ Volume: "volume"
4994
+ };
4995
+ var UsageModel1 = {
4996
+ Prepaid: "prepaid",
4997
+ PayPerUse: "pay_per_use"
4998
+ };
4999
+ var ConfigDuration1 = {
5000
+ Month: "month",
5001
+ Forever: "forever"
5002
+ };
5003
+ var CheckOnIncrease1 = {
5004
+ BillImmediately: "bill_immediately",
5005
+ ProrateImmediately: "prorate_immediately",
5006
+ ProrateNextCycle: "prorate_next_cycle",
5007
+ BillNextCycle: "bill_next_cycle"
5008
+ };
5009
+ var CheckOnDecrease1 = {
5010
+ Prorate: "prorate",
5011
+ ProrateImmediately: "prorate_immediately",
5012
+ ProrateNextCycle: "prorate_next_cycle",
5013
+ None: "none",
5014
+ NoProrations: "no_prorations"
5015
+ };
5016
+ var FreeTrialDuration1 = {
5017
+ Day: "day",
5018
+ Month: "month",
5019
+ Year: "year"
5020
+ };
5021
+ var ProductScenario1 = {
4946
5022
  Scheduled: "scheduled",
4947
5023
  Active: "active",
4948
5024
  New: "new",
@@ -4989,8 +5065,8 @@ var CheckParams$outboundSchema = z29.pipe(
4989
5065
  });
4990
5066
  })
4991
5067
  );
4992
- var FlagType$inboundSchema = inboundSchema(FlagType);
4993
- var CheckCreditSchema$inboundSchema = z29.pipe(
5068
+ var FlagType2$inboundSchema = inboundSchema(FlagType2);
5069
+ var CheckCreditSchema2$inboundSchema = z29.pipe(
4994
5070
  z29.object({
4995
5071
  metered_feature_id: string4(),
4996
5072
  credit_cost: number2()
@@ -5002,21 +5078,21 @@ var CheckCreditSchema$inboundSchema = z29.pipe(
5002
5078
  });
5003
5079
  })
5004
5080
  );
5005
- var FlagDisplay$inboundSchema = z29.object({
5081
+ var FlagDisplay2$inboundSchema = z29.object({
5006
5082
  singular: z29.optional(z29.nullable(string4())),
5007
5083
  plural: z29.optional(z29.nullable(string4()))
5008
5084
  });
5009
- var CheckFeature$inboundSchema = z29.pipe(
5085
+ var CheckFeature2$inboundSchema = z29.pipe(
5010
5086
  z29.object({
5011
5087
  id: string4(),
5012
5088
  name: string4(),
5013
- type: FlagType$inboundSchema,
5089
+ type: FlagType2$inboundSchema,
5014
5090
  consumable: boolean2(),
5015
5091
  event_names: optional2(z29.array(string4())),
5016
5092
  credit_schema: optional2(
5017
- z29.array(z29.lazy(() => CheckCreditSchema$inboundSchema))
5093
+ z29.array(z29.lazy(() => CheckCreditSchema2$inboundSchema))
5018
5094
  ),
5019
- display: optional2(z29.lazy(() => FlagDisplay$inboundSchema)),
5095
+ display: optional2(z29.lazy(() => FlagDisplay2$inboundSchema)),
5020
5096
  archived: boolean2()
5021
5097
  }),
5022
5098
  z29.transform((v) => {
@@ -5026,13 +5102,13 @@ var CheckFeature$inboundSchema = z29.pipe(
5026
5102
  });
5027
5103
  })
5028
5104
  );
5029
- var Flag$inboundSchema = z29.pipe(
5105
+ var Flag2$inboundSchema = z29.pipe(
5030
5106
  z29.object({
5031
5107
  id: string4(),
5032
5108
  plan_id: nullable(string4()),
5033
5109
  expires_at: nullable(number2()),
5034
5110
  feature_id: string4(),
5035
- feature: optional2(z29.lazy(() => CheckFeature$inboundSchema))
5111
+ feature: optional2(z29.lazy(() => CheckFeature2$inboundSchema))
5036
5112
  }),
5037
5113
  z29.transform((v) => {
5038
5114
  return remap(v, {
@@ -5042,15 +5118,15 @@ var Flag$inboundSchema = z29.pipe(
5042
5118
  });
5043
5119
  })
5044
5120
  );
5045
- var Scenario$inboundSchema = inboundSchema(Scenario);
5046
- var CheckEnv$inboundSchema = inboundSchema(CheckEnv);
5047
- var ProductType$inboundSchema = inboundSchema(ProductType);
5048
- var FeatureType$inboundSchema = inboundSchema(FeatureType);
5049
- var IncludedUsage$inboundSchema = smartUnion([number2(), string4()]);
5050
- var CheckInterval$inboundSchema = inboundSchema(CheckInterval);
5051
- var CheckTierBehavior$inboundSchema = inboundSchema(CheckTierBehavior);
5052
- var UsageModel$inboundSchema = inboundSchema(UsageModel);
5053
- var ProductDisplay$inboundSchema = z29.pipe(
5121
+ var Scenario2$inboundSchema = inboundSchema(Scenario2);
5122
+ var CheckEnv2$inboundSchema = inboundSchema(CheckEnv2);
5123
+ var ProductType2$inboundSchema = inboundSchema(ProductType2);
5124
+ var FeatureType2$inboundSchema = inboundSchema(FeatureType2);
5125
+ var IncludedUsage2$inboundSchema = smartUnion([number2(), string4()]);
5126
+ var CheckInterval2$inboundSchema = inboundSchema(CheckInterval2);
5127
+ var CheckTierBehavior2$inboundSchema = inboundSchema(CheckTierBehavior2);
5128
+ var UsageModel2$inboundSchema = inboundSchema(UsageModel2);
5129
+ var ProductDisplay2$inboundSchema = z29.pipe(
5054
5130
  z29.object({
5055
5131
  primary_text: string4(),
5056
5132
  secondary_text: z29.optional(z29.nullable(string4()))
@@ -5062,12 +5138,12 @@ var ProductDisplay$inboundSchema = z29.pipe(
5062
5138
  });
5063
5139
  })
5064
5140
  );
5065
- var ConfigDuration$inboundSchema = inboundSchema(ConfigDuration);
5066
- var CheckRollover$inboundSchema = z29.pipe(
5141
+ var ConfigDuration2$inboundSchema = inboundSchema(ConfigDuration2);
5142
+ var CheckRollover2$inboundSchema = z29.pipe(
5067
5143
  z29.object({
5068
5144
  max: z29.optional(z29.nullable(number2())),
5069
5145
  max_percentage: z29.optional(z29.nullable(number2())),
5070
- duration: z29._default(ConfigDuration$inboundSchema, "month"),
5146
+ duration: z29._default(ConfigDuration2$inboundSchema, "month"),
5071
5147
  length: number2()
5072
5148
  }),
5073
5149
  z29.transform((v) => {
@@ -5076,15 +5152,15 @@ var CheckRollover$inboundSchema = z29.pipe(
5076
5152
  });
5077
5153
  })
5078
5154
  );
5079
- var CheckOnIncrease$inboundSchema = inboundSchema(CheckOnIncrease);
5080
- var CheckOnDecrease$inboundSchema = inboundSchema(CheckOnDecrease);
5081
- var CheckConfig$inboundSchema = z29.pipe(
5155
+ var CheckOnIncrease2$inboundSchema = inboundSchema(CheckOnIncrease2);
5156
+ var CheckOnDecrease2$inboundSchema = inboundSchema(CheckOnDecrease2);
5157
+ var CheckConfig2$inboundSchema = z29.pipe(
5082
5158
  z29.object({
5083
5159
  rollover: z29.optional(
5084
- z29.nullable(z29.lazy(() => CheckRollover$inboundSchema))
5160
+ z29.nullable(z29.lazy(() => CheckRollover2$inboundSchema))
5085
5161
  ),
5086
- on_increase: z29.optional(z29.nullable(CheckOnIncrease$inboundSchema)),
5087
- on_decrease: z29.optional(z29.nullable(CheckOnDecrease$inboundSchema))
5162
+ on_increase: z29.optional(z29.nullable(CheckOnIncrease2$inboundSchema)),
5163
+ on_decrease: z29.optional(z29.nullable(CheckOnDecrease2$inboundSchema))
5088
5164
  }),
5089
5165
  z29.transform((v) => {
5090
5166
  return remap(v, {
@@ -5093,29 +5169,29 @@ var CheckConfig$inboundSchema = z29.pipe(
5093
5169
  });
5094
5170
  })
5095
5171
  );
5096
- var CheckItem$inboundSchema = z29.pipe(
5172
+ var CheckItem2$inboundSchema = z29.pipe(
5097
5173
  z29.object({
5098
- type: z29.optional(z29.nullable(ProductType$inboundSchema)),
5174
+ type: z29.optional(z29.nullable(ProductType2$inboundSchema)),
5099
5175
  feature_id: z29.optional(z29.nullable(string4())),
5100
- feature_type: z29.optional(z29.nullable(FeatureType$inboundSchema)),
5176
+ feature_type: z29.optional(z29.nullable(FeatureType2$inboundSchema)),
5101
5177
  included_usage: z29.optional(
5102
5178
  z29.nullable(smartUnion([number2(), string4()]))
5103
5179
  ),
5104
- interval: z29.optional(z29.nullable(CheckInterval$inboundSchema)),
5180
+ interval: z29.optional(z29.nullable(CheckInterval2$inboundSchema)),
5105
5181
  interval_count: z29.optional(z29.nullable(number2())),
5106
5182
  price: z29.optional(z29.nullable(number2())),
5107
5183
  tiers: z29.optional(z29.nullable(z29.array(nullable(z29.any())))),
5108
- tier_behavior: z29.optional(z29.nullable(CheckTierBehavior$inboundSchema)),
5109
- usage_model: z29.optional(z29.nullable(UsageModel$inboundSchema)),
5184
+ tier_behavior: z29.optional(z29.nullable(CheckTierBehavior2$inboundSchema)),
5185
+ usage_model: z29.optional(z29.nullable(UsageModel2$inboundSchema)),
5110
5186
  billing_units: z29.optional(z29.nullable(number2())),
5111
5187
  reset_usage_when_enabled: z29.optional(z29.nullable(boolean2())),
5112
5188
  entity_feature_id: z29.optional(z29.nullable(string4())),
5113
5189
  display: z29.optional(
5114
- z29.nullable(z29.lazy(() => ProductDisplay$inboundSchema))
5190
+ z29.nullable(z29.lazy(() => ProductDisplay2$inboundSchema))
5115
5191
  ),
5116
5192
  quantity: z29.optional(z29.nullable(number2())),
5117
5193
  next_cycle_quantity: z29.optional(z29.nullable(number2())),
5118
- config: z29.optional(z29.nullable(z29.lazy(() => CheckConfig$inboundSchema)))
5194
+ config: z29.optional(z29.nullable(z29.lazy(() => CheckConfig2$inboundSchema)))
5119
5195
  }),
5120
5196
  z29.transform((v) => {
5121
5197
  return remap(v, {
@@ -5132,10 +5208,10 @@ var CheckItem$inboundSchema = z29.pipe(
5132
5208
  });
5133
5209
  })
5134
5210
  );
5135
- var FreeTrialDuration$inboundSchema = inboundSchema(FreeTrialDuration);
5136
- var CheckFreeTrial$inboundSchema = z29.pipe(
5211
+ var FreeTrialDuration2$inboundSchema = inboundSchema(FreeTrialDuration2);
5212
+ var CheckFreeTrial2$inboundSchema = z29.pipe(
5137
5213
  z29.object({
5138
- duration: FreeTrialDuration$inboundSchema,
5214
+ duration: FreeTrialDuration2$inboundSchema,
5139
5215
  length: number2(),
5140
5216
  unique_fingerprint: boolean2(),
5141
5217
  card_required: boolean2(),
@@ -5149,8 +5225,8 @@ var CheckFreeTrial$inboundSchema = z29.pipe(
5149
5225
  });
5150
5226
  })
5151
5227
  );
5152
- var ProductScenario$inboundSchema = inboundSchema(ProductScenario);
5153
- var Properties$inboundSchema = z29.pipe(
5228
+ var ProductScenario2$inboundSchema = inboundSchema(ProductScenario2);
5229
+ var Properties2$inboundSchema = z29.pipe(
5154
5230
  z29.object({
5155
5231
  is_free: boolean2(),
5156
5232
  is_one_off: boolean2(),
@@ -5167,22 +5243,22 @@ var Properties$inboundSchema = z29.pipe(
5167
5243
  });
5168
5244
  })
5169
5245
  );
5170
- var Product$inboundSchema = z29.pipe(
5246
+ var Product2$inboundSchema = z29.pipe(
5171
5247
  z29.object({
5172
5248
  id: string4(),
5173
5249
  name: string4(),
5174
5250
  group: nullable(string4()),
5175
- env: CheckEnv$inboundSchema,
5251
+ env: CheckEnv2$inboundSchema,
5176
5252
  is_add_on: boolean2(),
5177
5253
  is_default: boolean2(),
5178
5254
  archived: boolean2(),
5179
5255
  version: number2(),
5180
5256
  created_at: number2(),
5181
- items: z29.array(z29.lazy(() => CheckItem$inboundSchema)),
5182
- free_trial: nullable(z29.lazy(() => CheckFreeTrial$inboundSchema)),
5257
+ items: z29.array(z29.lazy(() => CheckItem2$inboundSchema)),
5258
+ free_trial: nullable(z29.lazy(() => CheckFreeTrial2$inboundSchema)),
5183
5259
  base_variant_id: nullable(string4()),
5184
- scenario: optional2(ProductScenario$inboundSchema),
5185
- properties: optional2(z29.lazy(() => Properties$inboundSchema))
5260
+ scenario: optional2(ProductScenario2$inboundSchema),
5261
+ properties: optional2(z29.lazy(() => Properties2$inboundSchema))
5186
5262
  }),
5187
5263
  z29.transform((v) => {
5188
5264
  return remap(v, {
@@ -5194,14 +5270,14 @@ var Product$inboundSchema = z29.pipe(
5194
5270
  });
5195
5271
  })
5196
5272
  );
5197
- var Preview$inboundSchema = z29.pipe(
5273
+ var Preview2$inboundSchema = z29.pipe(
5198
5274
  z29.object({
5199
- scenario: Scenario$inboundSchema,
5275
+ scenario: Scenario2$inboundSchema,
5200
5276
  title: string4(),
5201
5277
  message: string4(),
5202
5278
  feature_id: string4(),
5203
5279
  feature_name: string4(),
5204
- products: z29.array(z29.lazy(() => Product$inboundSchema))
5280
+ products: z29.array(z29.lazy(() => Product2$inboundSchema))
5205
5281
  }),
5206
5282
  z29.transform((v) => {
5207
5283
  return remap(v, {
@@ -5210,15 +5286,15 @@ var Preview$inboundSchema = z29.pipe(
5210
5286
  });
5211
5287
  })
5212
5288
  );
5213
- var CheckResponse$inboundSchema = z29.pipe(
5289
+ var CheckResponseBody2$inboundSchema = z29.pipe(
5214
5290
  z29.object({
5215
5291
  allowed: boolean2(),
5216
5292
  customer_id: string4(),
5217
5293
  entity_id: z29.optional(z29.nullable(string4())),
5218
5294
  required_balance: optional2(number2()),
5219
5295
  balance: nullable(Balance$inboundSchema),
5220
- flag: nullable(z29.lazy(() => Flag$inboundSchema)),
5221
- preview: optional2(z29.lazy(() => Preview$inboundSchema))
5296
+ flag: nullable(z29.lazy(() => Flag2$inboundSchema)),
5297
+ preview: optional2(z29.lazy(() => Preview2$inboundSchema))
5222
5298
  }),
5223
5299
  z29.transform((v) => {
5224
5300
  return remap(v, {
@@ -5228,6 +5304,249 @@ var CheckResponse$inboundSchema = z29.pipe(
5228
5304
  });
5229
5305
  })
5230
5306
  );
5307
+ var FlagType1$inboundSchema = inboundSchema(FlagType1);
5308
+ var CheckCreditSchema1$inboundSchema = z29.pipe(
5309
+ z29.object({
5310
+ metered_feature_id: string4(),
5311
+ credit_cost: number2()
5312
+ }),
5313
+ z29.transform((v) => {
5314
+ return remap(v, {
5315
+ "metered_feature_id": "meteredFeatureId",
5316
+ "credit_cost": "creditCost"
5317
+ });
5318
+ })
5319
+ );
5320
+ var FlagDisplay1$inboundSchema = z29.object({
5321
+ singular: z29.optional(z29.nullable(string4())),
5322
+ plural: z29.optional(z29.nullable(string4()))
5323
+ });
5324
+ var CheckFeature1$inboundSchema = z29.pipe(
5325
+ z29.object({
5326
+ id: string4(),
5327
+ name: string4(),
5328
+ type: FlagType1$inboundSchema,
5329
+ consumable: boolean2(),
5330
+ event_names: optional2(z29.array(string4())),
5331
+ credit_schema: optional2(
5332
+ z29.array(z29.lazy(() => CheckCreditSchema1$inboundSchema))
5333
+ ),
5334
+ display: optional2(z29.lazy(() => FlagDisplay1$inboundSchema)),
5335
+ archived: boolean2()
5336
+ }),
5337
+ z29.transform((v) => {
5338
+ return remap(v, {
5339
+ "event_names": "eventNames",
5340
+ "credit_schema": "creditSchema"
5341
+ });
5342
+ })
5343
+ );
5344
+ var Flag1$inboundSchema = z29.pipe(
5345
+ z29.object({
5346
+ id: string4(),
5347
+ plan_id: nullable(string4()),
5348
+ expires_at: nullable(number2()),
5349
+ feature_id: string4(),
5350
+ feature: optional2(z29.lazy(() => CheckFeature1$inboundSchema))
5351
+ }),
5352
+ z29.transform((v) => {
5353
+ return remap(v, {
5354
+ "plan_id": "planId",
5355
+ "expires_at": "expiresAt",
5356
+ "feature_id": "featureId"
5357
+ });
5358
+ })
5359
+ );
5360
+ var Scenario1$inboundSchema = inboundSchema(Scenario1);
5361
+ var CheckEnv1$inboundSchema = inboundSchema(CheckEnv1);
5362
+ var ProductType1$inboundSchema = inboundSchema(ProductType1);
5363
+ var FeatureType1$inboundSchema = inboundSchema(FeatureType1);
5364
+ var IncludedUsage1$inboundSchema = smartUnion([number2(), string4()]);
5365
+ var CheckInterval1$inboundSchema = inboundSchema(CheckInterval1);
5366
+ var CheckTierBehavior1$inboundSchema = inboundSchema(CheckTierBehavior1);
5367
+ var UsageModel1$inboundSchema = inboundSchema(UsageModel1);
5368
+ var ProductDisplay1$inboundSchema = z29.pipe(
5369
+ z29.object({
5370
+ primary_text: string4(),
5371
+ secondary_text: z29.optional(z29.nullable(string4()))
5372
+ }),
5373
+ z29.transform((v) => {
5374
+ return remap(v, {
5375
+ "primary_text": "primaryText",
5376
+ "secondary_text": "secondaryText"
5377
+ });
5378
+ })
5379
+ );
5380
+ var ConfigDuration1$inboundSchema = inboundSchema(ConfigDuration1);
5381
+ var CheckRollover1$inboundSchema = z29.pipe(
5382
+ z29.object({
5383
+ max: z29.optional(z29.nullable(number2())),
5384
+ max_percentage: z29.optional(z29.nullable(number2())),
5385
+ duration: z29._default(ConfigDuration1$inboundSchema, "month"),
5386
+ length: number2()
5387
+ }),
5388
+ z29.transform((v) => {
5389
+ return remap(v, {
5390
+ "max_percentage": "maxPercentage"
5391
+ });
5392
+ })
5393
+ );
5394
+ var CheckOnIncrease1$inboundSchema = inboundSchema(CheckOnIncrease1);
5395
+ var CheckOnDecrease1$inboundSchema = inboundSchema(CheckOnDecrease1);
5396
+ var CheckConfig1$inboundSchema = z29.pipe(
5397
+ z29.object({
5398
+ rollover: z29.optional(
5399
+ z29.nullable(z29.lazy(() => CheckRollover1$inboundSchema))
5400
+ ),
5401
+ on_increase: z29.optional(z29.nullable(CheckOnIncrease1$inboundSchema)),
5402
+ on_decrease: z29.optional(z29.nullable(CheckOnDecrease1$inboundSchema))
5403
+ }),
5404
+ z29.transform((v) => {
5405
+ return remap(v, {
5406
+ "on_increase": "onIncrease",
5407
+ "on_decrease": "onDecrease"
5408
+ });
5409
+ })
5410
+ );
5411
+ var CheckItem1$inboundSchema = z29.pipe(
5412
+ z29.object({
5413
+ type: z29.optional(z29.nullable(ProductType1$inboundSchema)),
5414
+ feature_id: z29.optional(z29.nullable(string4())),
5415
+ feature_type: z29.optional(z29.nullable(FeatureType1$inboundSchema)),
5416
+ included_usage: z29.optional(
5417
+ z29.nullable(smartUnion([number2(), string4()]))
5418
+ ),
5419
+ interval: z29.optional(z29.nullable(CheckInterval1$inboundSchema)),
5420
+ interval_count: z29.optional(z29.nullable(number2())),
5421
+ price: z29.optional(z29.nullable(number2())),
5422
+ tiers: z29.optional(z29.nullable(z29.array(nullable(z29.any())))),
5423
+ tier_behavior: z29.optional(z29.nullable(CheckTierBehavior1$inboundSchema)),
5424
+ usage_model: z29.optional(z29.nullable(UsageModel1$inboundSchema)),
5425
+ billing_units: z29.optional(z29.nullable(number2())),
5426
+ reset_usage_when_enabled: z29.optional(z29.nullable(boolean2())),
5427
+ entity_feature_id: z29.optional(z29.nullable(string4())),
5428
+ display: z29.optional(
5429
+ z29.nullable(z29.lazy(() => ProductDisplay1$inboundSchema))
5430
+ ),
5431
+ quantity: z29.optional(z29.nullable(number2())),
5432
+ next_cycle_quantity: z29.optional(z29.nullable(number2())),
5433
+ config: z29.optional(z29.nullable(z29.lazy(() => CheckConfig1$inboundSchema)))
5434
+ }),
5435
+ z29.transform((v) => {
5436
+ return remap(v, {
5437
+ "feature_id": "featureId",
5438
+ "feature_type": "featureType",
5439
+ "included_usage": "includedUsage",
5440
+ "interval_count": "intervalCount",
5441
+ "tier_behavior": "tierBehavior",
5442
+ "usage_model": "usageModel",
5443
+ "billing_units": "billingUnits",
5444
+ "reset_usage_when_enabled": "resetUsageWhenEnabled",
5445
+ "entity_feature_id": "entityFeatureId",
5446
+ "next_cycle_quantity": "nextCycleQuantity"
5447
+ });
5448
+ })
5449
+ );
5450
+ var FreeTrialDuration1$inboundSchema = inboundSchema(FreeTrialDuration1);
5451
+ var CheckFreeTrial1$inboundSchema = z29.pipe(
5452
+ z29.object({
5453
+ duration: FreeTrialDuration1$inboundSchema,
5454
+ length: number2(),
5455
+ unique_fingerprint: boolean2(),
5456
+ card_required: boolean2(),
5457
+ trial_available: z29.nullable(z29._default(boolean2(), true))
5458
+ }),
5459
+ z29.transform((v) => {
5460
+ return remap(v, {
5461
+ "unique_fingerprint": "uniqueFingerprint",
5462
+ "card_required": "cardRequired",
5463
+ "trial_available": "trialAvailable"
5464
+ });
5465
+ })
5466
+ );
5467
+ var ProductScenario1$inboundSchema = inboundSchema(ProductScenario1);
5468
+ var Properties1$inboundSchema = z29.pipe(
5469
+ z29.object({
5470
+ is_free: boolean2(),
5471
+ is_one_off: boolean2(),
5472
+ interval_group: z29.optional(z29.nullable(string4())),
5473
+ has_trial: z29.optional(z29.nullable(boolean2())),
5474
+ updateable: z29.optional(z29.nullable(boolean2()))
5475
+ }),
5476
+ z29.transform((v) => {
5477
+ return remap(v, {
5478
+ "is_free": "isFree",
5479
+ "is_one_off": "isOneOff",
5480
+ "interval_group": "intervalGroup",
5481
+ "has_trial": "hasTrial"
5482
+ });
5483
+ })
5484
+ );
5485
+ var Product1$inboundSchema = z29.pipe(
5486
+ z29.object({
5487
+ id: string4(),
5488
+ name: string4(),
5489
+ group: nullable(string4()),
5490
+ env: CheckEnv1$inboundSchema,
5491
+ is_add_on: boolean2(),
5492
+ is_default: boolean2(),
5493
+ archived: boolean2(),
5494
+ version: number2(),
5495
+ created_at: number2(),
5496
+ items: z29.array(z29.lazy(() => CheckItem1$inboundSchema)),
5497
+ free_trial: nullable(z29.lazy(() => CheckFreeTrial1$inboundSchema)),
5498
+ base_variant_id: nullable(string4()),
5499
+ scenario: optional2(ProductScenario1$inboundSchema),
5500
+ properties: optional2(z29.lazy(() => Properties1$inboundSchema))
5501
+ }),
5502
+ z29.transform((v) => {
5503
+ return remap(v, {
5504
+ "is_add_on": "isAddOn",
5505
+ "is_default": "isDefault",
5506
+ "created_at": "createdAt",
5507
+ "free_trial": "freeTrial",
5508
+ "base_variant_id": "baseVariantId"
5509
+ });
5510
+ })
5511
+ );
5512
+ var Preview1$inboundSchema = z29.pipe(
5513
+ z29.object({
5514
+ scenario: Scenario1$inboundSchema,
5515
+ title: string4(),
5516
+ message: string4(),
5517
+ feature_id: string4(),
5518
+ feature_name: string4(),
5519
+ products: z29.array(z29.lazy(() => Product1$inboundSchema))
5520
+ }),
5521
+ z29.transform((v) => {
5522
+ return remap(v, {
5523
+ "feature_id": "featureId",
5524
+ "feature_name": "featureName"
5525
+ });
5526
+ })
5527
+ );
5528
+ var CheckResponseBody1$inboundSchema = z29.pipe(
5529
+ z29.object({
5530
+ allowed: boolean2(),
5531
+ customer_id: string4(),
5532
+ entity_id: z29.optional(z29.nullable(string4())),
5533
+ required_balance: optional2(number2()),
5534
+ balance: nullable(Balance$inboundSchema),
5535
+ flag: nullable(z29.lazy(() => Flag1$inboundSchema)),
5536
+ preview: optional2(z29.lazy(() => Preview1$inboundSchema))
5537
+ }),
5538
+ z29.transform((v) => {
5539
+ return remap(v, {
5540
+ "customer_id": "customerId",
5541
+ "entity_id": "entityId",
5542
+ "required_balance": "requiredBalance"
5543
+ });
5544
+ })
5545
+ );
5546
+ var CheckResponse$inboundSchema = smartUnion([
5547
+ z29.lazy(() => CheckResponseBody1$inboundSchema),
5548
+ z29.lazy(() => CheckResponseBody2$inboundSchema)
5549
+ ]);
5231
5550
 
5232
5551
  // ../sdk/src/models/create-balance-op.ts
5233
5552
  var z30 = __toESM(require("zod/v4-mini"), 1);
@@ -7202,9 +7521,16 @@ var FinalizeBalanceParams$outboundSchema = z43.pipe(
7202
7521
  });
7203
7522
  })
7204
7523
  );
7205
- var FinalizeLockResponse$inboundSchema = z43.object({
7524
+ var FinalizeLockResponseBody2$inboundSchema = z43.object({
7206
7525
  success: boolean2()
7207
7526
  });
7527
+ var FinalizeLockResponseBody1$inboundSchema = z43.object({
7528
+ success: boolean2()
7529
+ });
7530
+ var FinalizeLockResponse$inboundSchema = smartUnion([
7531
+ z43.lazy(() => FinalizeLockResponseBody1$inboundSchema),
7532
+ z43.lazy(() => FinalizeLockResponseBody2$inboundSchema)
7533
+ ]);
7208
7534
 
7209
7535
  // ../sdk/src/models/get-entity-op.ts
7210
7536
  var z44 = __toESM(require("zod/v4-mini"), 1);
@@ -11240,7 +11566,7 @@ var TrackParams$outboundSchema = z59.pipe(
11240
11566
  });
11241
11567
  })
11242
11568
  );
11243
- var TrackResponse$inboundSchema = z59.pipe(
11569
+ var TrackResponseBody2$inboundSchema = z59.pipe(
11244
11570
  z59.object({
11245
11571
  customer_id: string4(),
11246
11572
  entity_id: optional2(string4()),
@@ -11257,6 +11583,27 @@ var TrackResponse$inboundSchema = z59.pipe(
11257
11583
  });
11258
11584
  })
11259
11585
  );
11586
+ var TrackResponseBody1$inboundSchema = z59.pipe(
11587
+ z59.object({
11588
+ customer_id: string4(),
11589
+ entity_id: optional2(string4()),
11590
+ event_name: optional2(string4()),
11591
+ value: number2(),
11592
+ balance: nullable(Balance$inboundSchema),
11593
+ balances: optional2(z59.record(z59.string(), Balance$inboundSchema))
11594
+ }),
11595
+ z59.transform((v) => {
11596
+ return remap(v, {
11597
+ "customer_id": "customerId",
11598
+ "entity_id": "entityId",
11599
+ "event_name": "eventName"
11600
+ });
11601
+ })
11602
+ );
11603
+ var TrackResponse$inboundSchema = smartUnion([
11604
+ z59.lazy(() => TrackResponseBody1$inboundSchema),
11605
+ z59.lazy(() => TrackResponseBody2$inboundSchema)
11606
+ ]);
11260
11607
 
11261
11608
  // ../sdk/src/models/update-balance-op.ts
11262
11609
  var z60 = __toESM(require("zod/v4-mini"), 1);
@@ -12741,6 +13088,7 @@ async function $do(client, request, options) {
12741
13088
  const response = doResult.value;
12742
13089
  const [result] = await match(
12743
13090
  json(200, CheckResponse$inboundSchema),
13091
+ json(202, CheckResponse$inboundSchema),
12744
13092
  fail("4XX"),
12745
13093
  fail("5XX")
12746
13094
  )(response, req);
@@ -12819,6 +13167,7 @@ async function $do2(client, request, options) {
12819
13167
  const response = doResult.value;
12820
13168
  const [result] = await match(
12821
13169
  json(200, TrackResponse$inboundSchema),
13170
+ json(202, TrackResponse$inboundSchema),
12822
13171
  fail("4XX"),
12823
13172
  fail("5XX")
12824
13173
  )(response, req);
@@ -13658,6 +14007,7 @@ async function $do5(client, request, options) {
13658
14007
  const response = doResult.value;
13659
14008
  const [result] = await match(
13660
14009
  json(200, FinalizeLockResponse$inboundSchema),
14010
+ json(202, FinalizeLockResponse$inboundSchema),
13661
14011
  fail("4XX"),
13662
14012
  fail("5XX")
13663
14013
  )(response, req);
@@ -17056,7 +17406,7 @@ var Autumn = class extends ClientSDK {
17056
17406
  * @param lock - Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold. (optional)
17057
17407
  * @param withPreview - If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls. (optional)
17058
17408
  *
17059
- * @returns Whether access is allowed, plus the current balance for that feature.
17409
+ * @returns Whether access is allowed, plus the current balance for that feature. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 and allow access fail-open.
17060
17410
  */
17061
17411
  async check(request, options) {
17062
17412
  return unwrapAsync(check(
@@ -17089,7 +17439,7 @@ var Autumn = class extends ClientSDK {
17089
17439
  * @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
17090
17440
  * @param properties - Additional properties to attach to this usage event. (optional)
17091
17441
  *
17092
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances.
17442
+ * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
17093
17443
  */
17094
17444
  async track(request, options) {
17095
17445
  return unwrapAsync(track(