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
@@ -2199,31 +2199,31 @@ var BillingUpdateResponse$inboundSchema = z12.pipe(
2199
2199
 
2200
2200
  // ../sdk/src/models/check-op.ts
2201
2201
  import * as z13 from "zod/v4-mini";
2202
- var FlagType = {
2202
+ var FlagType2 = {
2203
2203
  Boolean: "boolean",
2204
2204
  Metered: "metered",
2205
2205
  CreditSystem: "credit_system"
2206
2206
  };
2207
- var Scenario = {
2207
+ var Scenario2 = {
2208
2208
  UsageLimit: "usage_limit",
2209
2209
  FeatureFlag: "feature_flag"
2210
2210
  };
2211
- var CheckEnv = {
2211
+ var CheckEnv2 = {
2212
2212
  Sandbox: "sandbox",
2213
2213
  Live: "live"
2214
2214
  };
2215
- var ProductType = {
2215
+ var ProductType2 = {
2216
2216
  Feature: "feature",
2217
2217
  PricedFeature: "priced_feature",
2218
2218
  Price: "price"
2219
2219
  };
2220
- var FeatureType = {
2220
+ var FeatureType2 = {
2221
2221
  SingleUse: "single_use",
2222
2222
  ContinuousUse: "continuous_use",
2223
2223
  Boolean: "boolean",
2224
2224
  Static: "static"
2225
2225
  };
2226
- var CheckInterval = {
2226
+ var CheckInterval2 = {
2227
2227
  Minute: "minute",
2228
2228
  Hour: "hour",
2229
2229
  Day: "day",
@@ -2233,37 +2233,113 @@ var CheckInterval = {
2233
2233
  SemiAnnual: "semi_annual",
2234
2234
  Year: "year"
2235
2235
  };
2236
- var CheckTierBehavior = {
2236
+ var CheckTierBehavior2 = {
2237
2237
  Graduated: "graduated",
2238
2238
  Volume: "volume"
2239
2239
  };
2240
- var UsageModel = {
2240
+ var UsageModel2 = {
2241
2241
  Prepaid: "prepaid",
2242
2242
  PayPerUse: "pay_per_use"
2243
2243
  };
2244
- var ConfigDuration = {
2244
+ var ConfigDuration2 = {
2245
2245
  Month: "month",
2246
2246
  Forever: "forever"
2247
2247
  };
2248
- var CheckOnIncrease = {
2248
+ var CheckOnIncrease2 = {
2249
2249
  BillImmediately: "bill_immediately",
2250
2250
  ProrateImmediately: "prorate_immediately",
2251
2251
  ProrateNextCycle: "prorate_next_cycle",
2252
2252
  BillNextCycle: "bill_next_cycle"
2253
2253
  };
2254
- var CheckOnDecrease = {
2254
+ var CheckOnDecrease2 = {
2255
2255
  Prorate: "prorate",
2256
2256
  ProrateImmediately: "prorate_immediately",
2257
2257
  ProrateNextCycle: "prorate_next_cycle",
2258
2258
  None: "none",
2259
2259
  NoProrations: "no_prorations"
2260
2260
  };
2261
- var FreeTrialDuration = {
2261
+ var FreeTrialDuration2 = {
2262
2262
  Day: "day",
2263
2263
  Month: "month",
2264
2264
  Year: "year"
2265
2265
  };
2266
- var ProductScenario = {
2266
+ var ProductScenario2 = {
2267
+ Scheduled: "scheduled",
2268
+ Active: "active",
2269
+ New: "new",
2270
+ Renew: "renew",
2271
+ Upgrade: "upgrade",
2272
+ UpdatePrepaidQuantity: "update_prepaid_quantity",
2273
+ Downgrade: "downgrade",
2274
+ Cancel: "cancel",
2275
+ Expired: "expired",
2276
+ PastDue: "past_due"
2277
+ };
2278
+ var FlagType1 = {
2279
+ Boolean: "boolean",
2280
+ Metered: "metered",
2281
+ CreditSystem: "credit_system"
2282
+ };
2283
+ var Scenario1 = {
2284
+ UsageLimit: "usage_limit",
2285
+ FeatureFlag: "feature_flag"
2286
+ };
2287
+ var CheckEnv1 = {
2288
+ Sandbox: "sandbox",
2289
+ Live: "live"
2290
+ };
2291
+ var ProductType1 = {
2292
+ Feature: "feature",
2293
+ PricedFeature: "priced_feature",
2294
+ Price: "price"
2295
+ };
2296
+ var FeatureType1 = {
2297
+ SingleUse: "single_use",
2298
+ ContinuousUse: "continuous_use",
2299
+ Boolean: "boolean",
2300
+ Static: "static"
2301
+ };
2302
+ var CheckInterval1 = {
2303
+ Minute: "minute",
2304
+ Hour: "hour",
2305
+ Day: "day",
2306
+ Week: "week",
2307
+ Month: "month",
2308
+ Quarter: "quarter",
2309
+ SemiAnnual: "semi_annual",
2310
+ Year: "year"
2311
+ };
2312
+ var CheckTierBehavior1 = {
2313
+ Graduated: "graduated",
2314
+ Volume: "volume"
2315
+ };
2316
+ var UsageModel1 = {
2317
+ Prepaid: "prepaid",
2318
+ PayPerUse: "pay_per_use"
2319
+ };
2320
+ var ConfigDuration1 = {
2321
+ Month: "month",
2322
+ Forever: "forever"
2323
+ };
2324
+ var CheckOnIncrease1 = {
2325
+ BillImmediately: "bill_immediately",
2326
+ ProrateImmediately: "prorate_immediately",
2327
+ ProrateNextCycle: "prorate_next_cycle",
2328
+ BillNextCycle: "bill_next_cycle"
2329
+ };
2330
+ var CheckOnDecrease1 = {
2331
+ Prorate: "prorate",
2332
+ ProrateImmediately: "prorate_immediately",
2333
+ ProrateNextCycle: "prorate_next_cycle",
2334
+ None: "none",
2335
+ NoProrations: "no_prorations"
2336
+ };
2337
+ var FreeTrialDuration1 = {
2338
+ Day: "day",
2339
+ Month: "month",
2340
+ Year: "year"
2341
+ };
2342
+ var ProductScenario1 = {
2267
2343
  Scheduled: "scheduled",
2268
2344
  Active: "active",
2269
2345
  New: "new",
@@ -2310,8 +2386,8 @@ var CheckParams$outboundSchema = z13.pipe(
2310
2386
  });
2311
2387
  })
2312
2388
  );
2313
- var FlagType$inboundSchema = inboundSchema(FlagType);
2314
- var CheckCreditSchema$inboundSchema = z13.pipe(
2389
+ var FlagType2$inboundSchema = inboundSchema(FlagType2);
2390
+ var CheckCreditSchema2$inboundSchema = z13.pipe(
2315
2391
  z13.object({
2316
2392
  metered_feature_id: string4(),
2317
2393
  credit_cost: number2()
@@ -2323,21 +2399,21 @@ var CheckCreditSchema$inboundSchema = z13.pipe(
2323
2399
  });
2324
2400
  })
2325
2401
  );
2326
- var FlagDisplay$inboundSchema = z13.object({
2402
+ var FlagDisplay2$inboundSchema = z13.object({
2327
2403
  singular: z13.optional(z13.nullable(string4())),
2328
2404
  plural: z13.optional(z13.nullable(string4()))
2329
2405
  });
2330
- var CheckFeature$inboundSchema = z13.pipe(
2406
+ var CheckFeature2$inboundSchema = z13.pipe(
2331
2407
  z13.object({
2332
2408
  id: string4(),
2333
2409
  name: string4(),
2334
- type: FlagType$inboundSchema,
2410
+ type: FlagType2$inboundSchema,
2335
2411
  consumable: boolean2(),
2336
2412
  event_names: optional2(z13.array(string4())),
2337
2413
  credit_schema: optional2(
2338
- z13.array(z13.lazy(() => CheckCreditSchema$inboundSchema))
2414
+ z13.array(z13.lazy(() => CheckCreditSchema2$inboundSchema))
2339
2415
  ),
2340
- display: optional2(z13.lazy(() => FlagDisplay$inboundSchema)),
2416
+ display: optional2(z13.lazy(() => FlagDisplay2$inboundSchema)),
2341
2417
  archived: boolean2()
2342
2418
  }),
2343
2419
  z13.transform((v) => {
@@ -2347,13 +2423,13 @@ var CheckFeature$inboundSchema = z13.pipe(
2347
2423
  });
2348
2424
  })
2349
2425
  );
2350
- var Flag$inboundSchema = z13.pipe(
2426
+ var Flag2$inboundSchema = z13.pipe(
2351
2427
  z13.object({
2352
2428
  id: string4(),
2353
2429
  plan_id: nullable(string4()),
2354
2430
  expires_at: nullable(number2()),
2355
2431
  feature_id: string4(),
2356
- feature: optional2(z13.lazy(() => CheckFeature$inboundSchema))
2432
+ feature: optional2(z13.lazy(() => CheckFeature2$inboundSchema))
2357
2433
  }),
2358
2434
  z13.transform((v) => {
2359
2435
  return remap(v, {
@@ -2363,15 +2439,15 @@ var Flag$inboundSchema = z13.pipe(
2363
2439
  });
2364
2440
  })
2365
2441
  );
2366
- var Scenario$inboundSchema = inboundSchema(Scenario);
2367
- var CheckEnv$inboundSchema = inboundSchema(CheckEnv);
2368
- var ProductType$inboundSchema = inboundSchema(ProductType);
2369
- var FeatureType$inboundSchema = inboundSchema(FeatureType);
2370
- var IncludedUsage$inboundSchema = smartUnion([number2(), string4()]);
2371
- var CheckInterval$inboundSchema = inboundSchema(CheckInterval);
2372
- var CheckTierBehavior$inboundSchema = inboundSchema(CheckTierBehavior);
2373
- var UsageModel$inboundSchema = inboundSchema(UsageModel);
2374
- var ProductDisplay$inboundSchema = z13.pipe(
2442
+ var Scenario2$inboundSchema = inboundSchema(Scenario2);
2443
+ var CheckEnv2$inboundSchema = inboundSchema(CheckEnv2);
2444
+ var ProductType2$inboundSchema = inboundSchema(ProductType2);
2445
+ var FeatureType2$inboundSchema = inboundSchema(FeatureType2);
2446
+ var IncludedUsage2$inboundSchema = smartUnion([number2(), string4()]);
2447
+ var CheckInterval2$inboundSchema = inboundSchema(CheckInterval2);
2448
+ var CheckTierBehavior2$inboundSchema = inboundSchema(CheckTierBehavior2);
2449
+ var UsageModel2$inboundSchema = inboundSchema(UsageModel2);
2450
+ var ProductDisplay2$inboundSchema = z13.pipe(
2375
2451
  z13.object({
2376
2452
  primary_text: string4(),
2377
2453
  secondary_text: z13.optional(z13.nullable(string4()))
@@ -2383,12 +2459,12 @@ var ProductDisplay$inboundSchema = z13.pipe(
2383
2459
  });
2384
2460
  })
2385
2461
  );
2386
- var ConfigDuration$inboundSchema = inboundSchema(ConfigDuration);
2387
- var CheckRollover$inboundSchema = z13.pipe(
2462
+ var ConfigDuration2$inboundSchema = inboundSchema(ConfigDuration2);
2463
+ var CheckRollover2$inboundSchema = z13.pipe(
2388
2464
  z13.object({
2389
2465
  max: z13.optional(z13.nullable(number2())),
2390
2466
  max_percentage: z13.optional(z13.nullable(number2())),
2391
- duration: z13._default(ConfigDuration$inboundSchema, "month"),
2467
+ duration: z13._default(ConfigDuration2$inboundSchema, "month"),
2392
2468
  length: number2()
2393
2469
  }),
2394
2470
  z13.transform((v) => {
@@ -2397,15 +2473,15 @@ var CheckRollover$inboundSchema = z13.pipe(
2397
2473
  });
2398
2474
  })
2399
2475
  );
2400
- var CheckOnIncrease$inboundSchema = inboundSchema(CheckOnIncrease);
2401
- var CheckOnDecrease$inboundSchema = inboundSchema(CheckOnDecrease);
2402
- var CheckConfig$inboundSchema = z13.pipe(
2476
+ var CheckOnIncrease2$inboundSchema = inboundSchema(CheckOnIncrease2);
2477
+ var CheckOnDecrease2$inboundSchema = inboundSchema(CheckOnDecrease2);
2478
+ var CheckConfig2$inboundSchema = z13.pipe(
2403
2479
  z13.object({
2404
2480
  rollover: z13.optional(
2405
- z13.nullable(z13.lazy(() => CheckRollover$inboundSchema))
2481
+ z13.nullable(z13.lazy(() => CheckRollover2$inboundSchema))
2406
2482
  ),
2407
- on_increase: z13.optional(z13.nullable(CheckOnIncrease$inboundSchema)),
2408
- on_decrease: z13.optional(z13.nullable(CheckOnDecrease$inboundSchema))
2483
+ on_increase: z13.optional(z13.nullable(CheckOnIncrease2$inboundSchema)),
2484
+ on_decrease: z13.optional(z13.nullable(CheckOnDecrease2$inboundSchema))
2409
2485
  }),
2410
2486
  z13.transform((v) => {
2411
2487
  return remap(v, {
@@ -2414,29 +2490,29 @@ var CheckConfig$inboundSchema = z13.pipe(
2414
2490
  });
2415
2491
  })
2416
2492
  );
2417
- var CheckItem$inboundSchema = z13.pipe(
2493
+ var CheckItem2$inboundSchema = z13.pipe(
2418
2494
  z13.object({
2419
- type: z13.optional(z13.nullable(ProductType$inboundSchema)),
2495
+ type: z13.optional(z13.nullable(ProductType2$inboundSchema)),
2420
2496
  feature_id: z13.optional(z13.nullable(string4())),
2421
- feature_type: z13.optional(z13.nullable(FeatureType$inboundSchema)),
2497
+ feature_type: z13.optional(z13.nullable(FeatureType2$inboundSchema)),
2422
2498
  included_usage: z13.optional(
2423
2499
  z13.nullable(smartUnion([number2(), string4()]))
2424
2500
  ),
2425
- interval: z13.optional(z13.nullable(CheckInterval$inboundSchema)),
2501
+ interval: z13.optional(z13.nullable(CheckInterval2$inboundSchema)),
2426
2502
  interval_count: z13.optional(z13.nullable(number2())),
2427
2503
  price: z13.optional(z13.nullable(number2())),
2428
2504
  tiers: z13.optional(z13.nullable(z13.array(nullable(z13.any())))),
2429
- tier_behavior: z13.optional(z13.nullable(CheckTierBehavior$inboundSchema)),
2430
- usage_model: z13.optional(z13.nullable(UsageModel$inboundSchema)),
2505
+ tier_behavior: z13.optional(z13.nullable(CheckTierBehavior2$inboundSchema)),
2506
+ usage_model: z13.optional(z13.nullable(UsageModel2$inboundSchema)),
2431
2507
  billing_units: z13.optional(z13.nullable(number2())),
2432
2508
  reset_usage_when_enabled: z13.optional(z13.nullable(boolean2())),
2433
2509
  entity_feature_id: z13.optional(z13.nullable(string4())),
2434
2510
  display: z13.optional(
2435
- z13.nullable(z13.lazy(() => ProductDisplay$inboundSchema))
2511
+ z13.nullable(z13.lazy(() => ProductDisplay2$inboundSchema))
2436
2512
  ),
2437
2513
  quantity: z13.optional(z13.nullable(number2())),
2438
2514
  next_cycle_quantity: z13.optional(z13.nullable(number2())),
2439
- config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig$inboundSchema)))
2515
+ config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig2$inboundSchema)))
2440
2516
  }),
2441
2517
  z13.transform((v) => {
2442
2518
  return remap(v, {
@@ -2453,10 +2529,10 @@ var CheckItem$inboundSchema = z13.pipe(
2453
2529
  });
2454
2530
  })
2455
2531
  );
2456
- var FreeTrialDuration$inboundSchema = inboundSchema(FreeTrialDuration);
2457
- var CheckFreeTrial$inboundSchema = z13.pipe(
2532
+ var FreeTrialDuration2$inboundSchema = inboundSchema(FreeTrialDuration2);
2533
+ var CheckFreeTrial2$inboundSchema = z13.pipe(
2458
2534
  z13.object({
2459
- duration: FreeTrialDuration$inboundSchema,
2535
+ duration: FreeTrialDuration2$inboundSchema,
2460
2536
  length: number2(),
2461
2537
  unique_fingerprint: boolean2(),
2462
2538
  card_required: boolean2(),
@@ -2470,8 +2546,8 @@ var CheckFreeTrial$inboundSchema = z13.pipe(
2470
2546
  });
2471
2547
  })
2472
2548
  );
2473
- var ProductScenario$inboundSchema = inboundSchema(ProductScenario);
2474
- var Properties$inboundSchema = z13.pipe(
2549
+ var ProductScenario2$inboundSchema = inboundSchema(ProductScenario2);
2550
+ var Properties2$inboundSchema = z13.pipe(
2475
2551
  z13.object({
2476
2552
  is_free: boolean2(),
2477
2553
  is_one_off: boolean2(),
@@ -2488,22 +2564,22 @@ var Properties$inboundSchema = z13.pipe(
2488
2564
  });
2489
2565
  })
2490
2566
  );
2491
- var Product$inboundSchema = z13.pipe(
2567
+ var Product2$inboundSchema = z13.pipe(
2492
2568
  z13.object({
2493
2569
  id: string4(),
2494
2570
  name: string4(),
2495
2571
  group: nullable(string4()),
2496
- env: CheckEnv$inboundSchema,
2572
+ env: CheckEnv2$inboundSchema,
2497
2573
  is_add_on: boolean2(),
2498
2574
  is_default: boolean2(),
2499
2575
  archived: boolean2(),
2500
2576
  version: number2(),
2501
2577
  created_at: number2(),
2502
- items: z13.array(z13.lazy(() => CheckItem$inboundSchema)),
2503
- free_trial: nullable(z13.lazy(() => CheckFreeTrial$inboundSchema)),
2578
+ items: z13.array(z13.lazy(() => CheckItem2$inboundSchema)),
2579
+ free_trial: nullable(z13.lazy(() => CheckFreeTrial2$inboundSchema)),
2504
2580
  base_variant_id: nullable(string4()),
2505
- scenario: optional2(ProductScenario$inboundSchema),
2506
- properties: optional2(z13.lazy(() => Properties$inboundSchema))
2581
+ scenario: optional2(ProductScenario2$inboundSchema),
2582
+ properties: optional2(z13.lazy(() => Properties2$inboundSchema))
2507
2583
  }),
2508
2584
  z13.transform((v) => {
2509
2585
  return remap(v, {
@@ -2515,14 +2591,14 @@ var Product$inboundSchema = z13.pipe(
2515
2591
  });
2516
2592
  })
2517
2593
  );
2518
- var Preview$inboundSchema = z13.pipe(
2594
+ var Preview2$inboundSchema = z13.pipe(
2519
2595
  z13.object({
2520
- scenario: Scenario$inboundSchema,
2596
+ scenario: Scenario2$inboundSchema,
2521
2597
  title: string4(),
2522
2598
  message: string4(),
2523
2599
  feature_id: string4(),
2524
2600
  feature_name: string4(),
2525
- products: z13.array(z13.lazy(() => Product$inboundSchema))
2601
+ products: z13.array(z13.lazy(() => Product2$inboundSchema))
2526
2602
  }),
2527
2603
  z13.transform((v) => {
2528
2604
  return remap(v, {
@@ -2531,15 +2607,15 @@ var Preview$inboundSchema = z13.pipe(
2531
2607
  });
2532
2608
  })
2533
2609
  );
2534
- var CheckResponse$inboundSchema = z13.pipe(
2610
+ var CheckResponseBody2$inboundSchema = z13.pipe(
2535
2611
  z13.object({
2536
2612
  allowed: boolean2(),
2537
2613
  customer_id: string4(),
2538
2614
  entity_id: z13.optional(z13.nullable(string4())),
2539
2615
  required_balance: optional2(number2()),
2540
2616
  balance: nullable(Balance$inboundSchema),
2541
- flag: nullable(z13.lazy(() => Flag$inboundSchema)),
2542
- preview: optional2(z13.lazy(() => Preview$inboundSchema))
2617
+ flag: nullable(z13.lazy(() => Flag2$inboundSchema)),
2618
+ preview: optional2(z13.lazy(() => Preview2$inboundSchema))
2543
2619
  }),
2544
2620
  z13.transform((v) => {
2545
2621
  return remap(v, {
@@ -2549,6 +2625,249 @@ var CheckResponse$inboundSchema = z13.pipe(
2549
2625
  });
2550
2626
  })
2551
2627
  );
2628
+ var FlagType1$inboundSchema = inboundSchema(FlagType1);
2629
+ var CheckCreditSchema1$inboundSchema = z13.pipe(
2630
+ z13.object({
2631
+ metered_feature_id: string4(),
2632
+ credit_cost: number2()
2633
+ }),
2634
+ z13.transform((v) => {
2635
+ return remap(v, {
2636
+ "metered_feature_id": "meteredFeatureId",
2637
+ "credit_cost": "creditCost"
2638
+ });
2639
+ })
2640
+ );
2641
+ var FlagDisplay1$inboundSchema = z13.object({
2642
+ singular: z13.optional(z13.nullable(string4())),
2643
+ plural: z13.optional(z13.nullable(string4()))
2644
+ });
2645
+ var CheckFeature1$inboundSchema = z13.pipe(
2646
+ z13.object({
2647
+ id: string4(),
2648
+ name: string4(),
2649
+ type: FlagType1$inboundSchema,
2650
+ consumable: boolean2(),
2651
+ event_names: optional2(z13.array(string4())),
2652
+ credit_schema: optional2(
2653
+ z13.array(z13.lazy(() => CheckCreditSchema1$inboundSchema))
2654
+ ),
2655
+ display: optional2(z13.lazy(() => FlagDisplay1$inboundSchema)),
2656
+ archived: boolean2()
2657
+ }),
2658
+ z13.transform((v) => {
2659
+ return remap(v, {
2660
+ "event_names": "eventNames",
2661
+ "credit_schema": "creditSchema"
2662
+ });
2663
+ })
2664
+ );
2665
+ var Flag1$inboundSchema = z13.pipe(
2666
+ z13.object({
2667
+ id: string4(),
2668
+ plan_id: nullable(string4()),
2669
+ expires_at: nullable(number2()),
2670
+ feature_id: string4(),
2671
+ feature: optional2(z13.lazy(() => CheckFeature1$inboundSchema))
2672
+ }),
2673
+ z13.transform((v) => {
2674
+ return remap(v, {
2675
+ "plan_id": "planId",
2676
+ "expires_at": "expiresAt",
2677
+ "feature_id": "featureId"
2678
+ });
2679
+ })
2680
+ );
2681
+ var Scenario1$inboundSchema = inboundSchema(Scenario1);
2682
+ var CheckEnv1$inboundSchema = inboundSchema(CheckEnv1);
2683
+ var ProductType1$inboundSchema = inboundSchema(ProductType1);
2684
+ var FeatureType1$inboundSchema = inboundSchema(FeatureType1);
2685
+ var IncludedUsage1$inboundSchema = smartUnion([number2(), string4()]);
2686
+ var CheckInterval1$inboundSchema = inboundSchema(CheckInterval1);
2687
+ var CheckTierBehavior1$inboundSchema = inboundSchema(CheckTierBehavior1);
2688
+ var UsageModel1$inboundSchema = inboundSchema(UsageModel1);
2689
+ var ProductDisplay1$inboundSchema = z13.pipe(
2690
+ z13.object({
2691
+ primary_text: string4(),
2692
+ secondary_text: z13.optional(z13.nullable(string4()))
2693
+ }),
2694
+ z13.transform((v) => {
2695
+ return remap(v, {
2696
+ "primary_text": "primaryText",
2697
+ "secondary_text": "secondaryText"
2698
+ });
2699
+ })
2700
+ );
2701
+ var ConfigDuration1$inboundSchema = inboundSchema(ConfigDuration1);
2702
+ var CheckRollover1$inboundSchema = z13.pipe(
2703
+ z13.object({
2704
+ max: z13.optional(z13.nullable(number2())),
2705
+ max_percentage: z13.optional(z13.nullable(number2())),
2706
+ duration: z13._default(ConfigDuration1$inboundSchema, "month"),
2707
+ length: number2()
2708
+ }),
2709
+ z13.transform((v) => {
2710
+ return remap(v, {
2711
+ "max_percentage": "maxPercentage"
2712
+ });
2713
+ })
2714
+ );
2715
+ var CheckOnIncrease1$inboundSchema = inboundSchema(CheckOnIncrease1);
2716
+ var CheckOnDecrease1$inboundSchema = inboundSchema(CheckOnDecrease1);
2717
+ var CheckConfig1$inboundSchema = z13.pipe(
2718
+ z13.object({
2719
+ rollover: z13.optional(
2720
+ z13.nullable(z13.lazy(() => CheckRollover1$inboundSchema))
2721
+ ),
2722
+ on_increase: z13.optional(z13.nullable(CheckOnIncrease1$inboundSchema)),
2723
+ on_decrease: z13.optional(z13.nullable(CheckOnDecrease1$inboundSchema))
2724
+ }),
2725
+ z13.transform((v) => {
2726
+ return remap(v, {
2727
+ "on_increase": "onIncrease",
2728
+ "on_decrease": "onDecrease"
2729
+ });
2730
+ })
2731
+ );
2732
+ var CheckItem1$inboundSchema = z13.pipe(
2733
+ z13.object({
2734
+ type: z13.optional(z13.nullable(ProductType1$inboundSchema)),
2735
+ feature_id: z13.optional(z13.nullable(string4())),
2736
+ feature_type: z13.optional(z13.nullable(FeatureType1$inboundSchema)),
2737
+ included_usage: z13.optional(
2738
+ z13.nullable(smartUnion([number2(), string4()]))
2739
+ ),
2740
+ interval: z13.optional(z13.nullable(CheckInterval1$inboundSchema)),
2741
+ interval_count: z13.optional(z13.nullable(number2())),
2742
+ price: z13.optional(z13.nullable(number2())),
2743
+ tiers: z13.optional(z13.nullable(z13.array(nullable(z13.any())))),
2744
+ tier_behavior: z13.optional(z13.nullable(CheckTierBehavior1$inboundSchema)),
2745
+ usage_model: z13.optional(z13.nullable(UsageModel1$inboundSchema)),
2746
+ billing_units: z13.optional(z13.nullable(number2())),
2747
+ reset_usage_when_enabled: z13.optional(z13.nullable(boolean2())),
2748
+ entity_feature_id: z13.optional(z13.nullable(string4())),
2749
+ display: z13.optional(
2750
+ z13.nullable(z13.lazy(() => ProductDisplay1$inboundSchema))
2751
+ ),
2752
+ quantity: z13.optional(z13.nullable(number2())),
2753
+ next_cycle_quantity: z13.optional(z13.nullable(number2())),
2754
+ config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig1$inboundSchema)))
2755
+ }),
2756
+ z13.transform((v) => {
2757
+ return remap(v, {
2758
+ "feature_id": "featureId",
2759
+ "feature_type": "featureType",
2760
+ "included_usage": "includedUsage",
2761
+ "interval_count": "intervalCount",
2762
+ "tier_behavior": "tierBehavior",
2763
+ "usage_model": "usageModel",
2764
+ "billing_units": "billingUnits",
2765
+ "reset_usage_when_enabled": "resetUsageWhenEnabled",
2766
+ "entity_feature_id": "entityFeatureId",
2767
+ "next_cycle_quantity": "nextCycleQuantity"
2768
+ });
2769
+ })
2770
+ );
2771
+ var FreeTrialDuration1$inboundSchema = inboundSchema(FreeTrialDuration1);
2772
+ var CheckFreeTrial1$inboundSchema = z13.pipe(
2773
+ z13.object({
2774
+ duration: FreeTrialDuration1$inboundSchema,
2775
+ length: number2(),
2776
+ unique_fingerprint: boolean2(),
2777
+ card_required: boolean2(),
2778
+ trial_available: z13.nullable(z13._default(boolean2(), true))
2779
+ }),
2780
+ z13.transform((v) => {
2781
+ return remap(v, {
2782
+ "unique_fingerprint": "uniqueFingerprint",
2783
+ "card_required": "cardRequired",
2784
+ "trial_available": "trialAvailable"
2785
+ });
2786
+ })
2787
+ );
2788
+ var ProductScenario1$inboundSchema = inboundSchema(ProductScenario1);
2789
+ var Properties1$inboundSchema = z13.pipe(
2790
+ z13.object({
2791
+ is_free: boolean2(),
2792
+ is_one_off: boolean2(),
2793
+ interval_group: z13.optional(z13.nullable(string4())),
2794
+ has_trial: z13.optional(z13.nullable(boolean2())),
2795
+ updateable: z13.optional(z13.nullable(boolean2()))
2796
+ }),
2797
+ z13.transform((v) => {
2798
+ return remap(v, {
2799
+ "is_free": "isFree",
2800
+ "is_one_off": "isOneOff",
2801
+ "interval_group": "intervalGroup",
2802
+ "has_trial": "hasTrial"
2803
+ });
2804
+ })
2805
+ );
2806
+ var Product1$inboundSchema = z13.pipe(
2807
+ z13.object({
2808
+ id: string4(),
2809
+ name: string4(),
2810
+ group: nullable(string4()),
2811
+ env: CheckEnv1$inboundSchema,
2812
+ is_add_on: boolean2(),
2813
+ is_default: boolean2(),
2814
+ archived: boolean2(),
2815
+ version: number2(),
2816
+ created_at: number2(),
2817
+ items: z13.array(z13.lazy(() => CheckItem1$inboundSchema)),
2818
+ free_trial: nullable(z13.lazy(() => CheckFreeTrial1$inboundSchema)),
2819
+ base_variant_id: nullable(string4()),
2820
+ scenario: optional2(ProductScenario1$inboundSchema),
2821
+ properties: optional2(z13.lazy(() => Properties1$inboundSchema))
2822
+ }),
2823
+ z13.transform((v) => {
2824
+ return remap(v, {
2825
+ "is_add_on": "isAddOn",
2826
+ "is_default": "isDefault",
2827
+ "created_at": "createdAt",
2828
+ "free_trial": "freeTrial",
2829
+ "base_variant_id": "baseVariantId"
2830
+ });
2831
+ })
2832
+ );
2833
+ var Preview1$inboundSchema = z13.pipe(
2834
+ z13.object({
2835
+ scenario: Scenario1$inboundSchema,
2836
+ title: string4(),
2837
+ message: string4(),
2838
+ feature_id: string4(),
2839
+ feature_name: string4(),
2840
+ products: z13.array(z13.lazy(() => Product1$inboundSchema))
2841
+ }),
2842
+ z13.transform((v) => {
2843
+ return remap(v, {
2844
+ "feature_id": "featureId",
2845
+ "feature_name": "featureName"
2846
+ });
2847
+ })
2848
+ );
2849
+ var CheckResponseBody1$inboundSchema = z13.pipe(
2850
+ z13.object({
2851
+ allowed: boolean2(),
2852
+ customer_id: string4(),
2853
+ entity_id: z13.optional(z13.nullable(string4())),
2854
+ required_balance: optional2(number2()),
2855
+ balance: nullable(Balance$inboundSchema),
2856
+ flag: nullable(z13.lazy(() => Flag1$inboundSchema)),
2857
+ preview: optional2(z13.lazy(() => Preview1$inboundSchema))
2858
+ }),
2859
+ z13.transform((v) => {
2860
+ return remap(v, {
2861
+ "customer_id": "customerId",
2862
+ "entity_id": "entityId",
2863
+ "required_balance": "requiredBalance"
2864
+ });
2865
+ })
2866
+ );
2867
+ var CheckResponse$inboundSchema = smartUnion([
2868
+ z13.lazy(() => CheckResponseBody1$inboundSchema),
2869
+ z13.lazy(() => CheckResponseBody2$inboundSchema)
2870
+ ]);
2552
2871
 
2553
2872
  // ../sdk/src/models/create-balance-op.ts
2554
2873
  import * as z14 from "zod/v4-mini";
@@ -4523,9 +4842,16 @@ var FinalizeBalanceParams$outboundSchema = z27.pipe(
4523
4842
  });
4524
4843
  })
4525
4844
  );
4526
- var FinalizeLockResponse$inboundSchema = z27.object({
4845
+ var FinalizeLockResponseBody2$inboundSchema = z27.object({
4527
4846
  success: boolean2()
4528
4847
  });
4848
+ var FinalizeLockResponseBody1$inboundSchema = z27.object({
4849
+ success: boolean2()
4850
+ });
4851
+ var FinalizeLockResponse$inboundSchema = smartUnion([
4852
+ z27.lazy(() => FinalizeLockResponseBody1$inboundSchema),
4853
+ z27.lazy(() => FinalizeLockResponseBody2$inboundSchema)
4854
+ ]);
4529
4855
 
4530
4856
  // ../sdk/src/models/get-entity-op.ts
4531
4857
  import * as z28 from "zod/v4-mini";
@@ -8561,7 +8887,7 @@ var TrackParams$outboundSchema = z43.pipe(
8561
8887
  });
8562
8888
  })
8563
8889
  );
8564
- var TrackResponse$inboundSchema = z43.pipe(
8890
+ var TrackResponseBody2$inboundSchema = z43.pipe(
8565
8891
  z43.object({
8566
8892
  customer_id: string4(),
8567
8893
  entity_id: optional2(string4()),
@@ -8578,6 +8904,27 @@ var TrackResponse$inboundSchema = z43.pipe(
8578
8904
  });
8579
8905
  })
8580
8906
  );
8907
+ var TrackResponseBody1$inboundSchema = z43.pipe(
8908
+ z43.object({
8909
+ customer_id: string4(),
8910
+ entity_id: optional2(string4()),
8911
+ event_name: optional2(string4()),
8912
+ value: number2(),
8913
+ balance: nullable(Balance$inboundSchema),
8914
+ balances: optional2(z43.record(z43.string(), Balance$inboundSchema))
8915
+ }),
8916
+ z43.transform((v) => {
8917
+ return remap(v, {
8918
+ "customer_id": "customerId",
8919
+ "entity_id": "entityId",
8920
+ "event_name": "eventName"
8921
+ });
8922
+ })
8923
+ );
8924
+ var TrackResponse$inboundSchema = smartUnion([
8925
+ z43.lazy(() => TrackResponseBody1$inboundSchema),
8926
+ z43.lazy(() => TrackResponseBody2$inboundSchema)
8927
+ ]);
8581
8928
 
8582
8929
  // ../sdk/src/models/update-balance-op.ts
8583
8930
  import * as z44 from "zod/v4-mini";
@@ -10062,6 +10409,7 @@ async function $do(client, request, options) {
10062
10409
  const response = doResult.value;
10063
10410
  const [result] = await match(
10064
10411
  json(200, CheckResponse$inboundSchema),
10412
+ json(202, CheckResponse$inboundSchema),
10065
10413
  fail("4XX"),
10066
10414
  fail("5XX")
10067
10415
  )(response, req);
@@ -10140,6 +10488,7 @@ async function $do2(client, request, options) {
10140
10488
  const response = doResult.value;
10141
10489
  const [result] = await match(
10142
10490
  json(200, TrackResponse$inboundSchema),
10491
+ json(202, TrackResponse$inboundSchema),
10143
10492
  fail("4XX"),
10144
10493
  fail("5XX")
10145
10494
  )(response, req);
@@ -11007,6 +11356,7 @@ async function $do5(client, request, options) {
11007
11356
  const response = doResult.value;
11008
11357
  const [result] = await match(
11009
11358
  json(200, FinalizeLockResponse$inboundSchema),
11359
+ json(202, FinalizeLockResponse$inboundSchema),
11010
11360
  fail("4XX"),
11011
11361
  fail("5XX")
11012
11362
  )(response, req);
@@ -14405,7 +14755,7 @@ var Autumn = class extends ClientSDK {
14405
14755
  * @param lock - Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold. (optional)
14406
14756
  * @param withPreview - If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls. (optional)
14407
14757
  *
14408
- * @returns Whether access is allowed, plus the current balance for that feature.
14758
+ * @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.
14409
14759
  */
14410
14760
  async check(request, options) {
14411
14761
  return unwrapAsync(check(
@@ -14438,7 +14788,7 @@ var Autumn = class extends ClientSDK {
14438
14788
  * @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
14439
14789
  * @param properties - Additional properties to attach to this usage event. (optional)
14440
14790
  *
14441
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances.
14791
+ * @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.
14442
14792
  */
14443
14793
  async track(request, options) {
14444
14794
  return unwrapAsync(track(