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
@@ -2285,31 +2285,31 @@ var BillingUpdateResponse$inboundSchema = z12.pipe(
2285
2285
 
2286
2286
  // ../sdk/src/models/check-op.ts
2287
2287
  var z13 = __toESM(require("zod/v4-mini"), 1);
2288
- var FlagType = {
2288
+ var FlagType2 = {
2289
2289
  Boolean: "boolean",
2290
2290
  Metered: "metered",
2291
2291
  CreditSystem: "credit_system"
2292
2292
  };
2293
- var Scenario = {
2293
+ var Scenario2 = {
2294
2294
  UsageLimit: "usage_limit",
2295
2295
  FeatureFlag: "feature_flag"
2296
2296
  };
2297
- var CheckEnv = {
2297
+ var CheckEnv2 = {
2298
2298
  Sandbox: "sandbox",
2299
2299
  Live: "live"
2300
2300
  };
2301
- var ProductType = {
2301
+ var ProductType2 = {
2302
2302
  Feature: "feature",
2303
2303
  PricedFeature: "priced_feature",
2304
2304
  Price: "price"
2305
2305
  };
2306
- var FeatureType = {
2306
+ var FeatureType2 = {
2307
2307
  SingleUse: "single_use",
2308
2308
  ContinuousUse: "continuous_use",
2309
2309
  Boolean: "boolean",
2310
2310
  Static: "static"
2311
2311
  };
2312
- var CheckInterval = {
2312
+ var CheckInterval2 = {
2313
2313
  Minute: "minute",
2314
2314
  Hour: "hour",
2315
2315
  Day: "day",
@@ -2319,37 +2319,113 @@ var CheckInterval = {
2319
2319
  SemiAnnual: "semi_annual",
2320
2320
  Year: "year"
2321
2321
  };
2322
- var CheckTierBehavior = {
2322
+ var CheckTierBehavior2 = {
2323
2323
  Graduated: "graduated",
2324
2324
  Volume: "volume"
2325
2325
  };
2326
- var UsageModel = {
2326
+ var UsageModel2 = {
2327
2327
  Prepaid: "prepaid",
2328
2328
  PayPerUse: "pay_per_use"
2329
2329
  };
2330
- var ConfigDuration = {
2330
+ var ConfigDuration2 = {
2331
2331
  Month: "month",
2332
2332
  Forever: "forever"
2333
2333
  };
2334
- var CheckOnIncrease = {
2334
+ var CheckOnIncrease2 = {
2335
2335
  BillImmediately: "bill_immediately",
2336
2336
  ProrateImmediately: "prorate_immediately",
2337
2337
  ProrateNextCycle: "prorate_next_cycle",
2338
2338
  BillNextCycle: "bill_next_cycle"
2339
2339
  };
2340
- var CheckOnDecrease = {
2340
+ var CheckOnDecrease2 = {
2341
2341
  Prorate: "prorate",
2342
2342
  ProrateImmediately: "prorate_immediately",
2343
2343
  ProrateNextCycle: "prorate_next_cycle",
2344
2344
  None: "none",
2345
2345
  NoProrations: "no_prorations"
2346
2346
  };
2347
- var FreeTrialDuration = {
2347
+ var FreeTrialDuration2 = {
2348
2348
  Day: "day",
2349
2349
  Month: "month",
2350
2350
  Year: "year"
2351
2351
  };
2352
- var ProductScenario = {
2352
+ var ProductScenario2 = {
2353
+ Scheduled: "scheduled",
2354
+ Active: "active",
2355
+ New: "new",
2356
+ Renew: "renew",
2357
+ Upgrade: "upgrade",
2358
+ UpdatePrepaidQuantity: "update_prepaid_quantity",
2359
+ Downgrade: "downgrade",
2360
+ Cancel: "cancel",
2361
+ Expired: "expired",
2362
+ PastDue: "past_due"
2363
+ };
2364
+ var FlagType1 = {
2365
+ Boolean: "boolean",
2366
+ Metered: "metered",
2367
+ CreditSystem: "credit_system"
2368
+ };
2369
+ var Scenario1 = {
2370
+ UsageLimit: "usage_limit",
2371
+ FeatureFlag: "feature_flag"
2372
+ };
2373
+ var CheckEnv1 = {
2374
+ Sandbox: "sandbox",
2375
+ Live: "live"
2376
+ };
2377
+ var ProductType1 = {
2378
+ Feature: "feature",
2379
+ PricedFeature: "priced_feature",
2380
+ Price: "price"
2381
+ };
2382
+ var FeatureType1 = {
2383
+ SingleUse: "single_use",
2384
+ ContinuousUse: "continuous_use",
2385
+ Boolean: "boolean",
2386
+ Static: "static"
2387
+ };
2388
+ var CheckInterval1 = {
2389
+ Minute: "minute",
2390
+ Hour: "hour",
2391
+ Day: "day",
2392
+ Week: "week",
2393
+ Month: "month",
2394
+ Quarter: "quarter",
2395
+ SemiAnnual: "semi_annual",
2396
+ Year: "year"
2397
+ };
2398
+ var CheckTierBehavior1 = {
2399
+ Graduated: "graduated",
2400
+ Volume: "volume"
2401
+ };
2402
+ var UsageModel1 = {
2403
+ Prepaid: "prepaid",
2404
+ PayPerUse: "pay_per_use"
2405
+ };
2406
+ var ConfigDuration1 = {
2407
+ Month: "month",
2408
+ Forever: "forever"
2409
+ };
2410
+ var CheckOnIncrease1 = {
2411
+ BillImmediately: "bill_immediately",
2412
+ ProrateImmediately: "prorate_immediately",
2413
+ ProrateNextCycle: "prorate_next_cycle",
2414
+ BillNextCycle: "bill_next_cycle"
2415
+ };
2416
+ var CheckOnDecrease1 = {
2417
+ Prorate: "prorate",
2418
+ ProrateImmediately: "prorate_immediately",
2419
+ ProrateNextCycle: "prorate_next_cycle",
2420
+ None: "none",
2421
+ NoProrations: "no_prorations"
2422
+ };
2423
+ var FreeTrialDuration1 = {
2424
+ Day: "day",
2425
+ Month: "month",
2426
+ Year: "year"
2427
+ };
2428
+ var ProductScenario1 = {
2353
2429
  Scheduled: "scheduled",
2354
2430
  Active: "active",
2355
2431
  New: "new",
@@ -2396,8 +2472,8 @@ var CheckParams$outboundSchema = z13.pipe(
2396
2472
  });
2397
2473
  })
2398
2474
  );
2399
- var FlagType$inboundSchema = inboundSchema(FlagType);
2400
- var CheckCreditSchema$inboundSchema = z13.pipe(
2475
+ var FlagType2$inboundSchema = inboundSchema(FlagType2);
2476
+ var CheckCreditSchema2$inboundSchema = z13.pipe(
2401
2477
  z13.object({
2402
2478
  metered_feature_id: string4(),
2403
2479
  credit_cost: number2()
@@ -2409,21 +2485,21 @@ var CheckCreditSchema$inboundSchema = z13.pipe(
2409
2485
  });
2410
2486
  })
2411
2487
  );
2412
- var FlagDisplay$inboundSchema = z13.object({
2488
+ var FlagDisplay2$inboundSchema = z13.object({
2413
2489
  singular: z13.optional(z13.nullable(string4())),
2414
2490
  plural: z13.optional(z13.nullable(string4()))
2415
2491
  });
2416
- var CheckFeature$inboundSchema = z13.pipe(
2492
+ var CheckFeature2$inboundSchema = z13.pipe(
2417
2493
  z13.object({
2418
2494
  id: string4(),
2419
2495
  name: string4(),
2420
- type: FlagType$inboundSchema,
2496
+ type: FlagType2$inboundSchema,
2421
2497
  consumable: boolean2(),
2422
2498
  event_names: optional2(z13.array(string4())),
2423
2499
  credit_schema: optional2(
2424
- z13.array(z13.lazy(() => CheckCreditSchema$inboundSchema))
2500
+ z13.array(z13.lazy(() => CheckCreditSchema2$inboundSchema))
2425
2501
  ),
2426
- display: optional2(z13.lazy(() => FlagDisplay$inboundSchema)),
2502
+ display: optional2(z13.lazy(() => FlagDisplay2$inboundSchema)),
2427
2503
  archived: boolean2()
2428
2504
  }),
2429
2505
  z13.transform((v) => {
@@ -2433,13 +2509,13 @@ var CheckFeature$inboundSchema = z13.pipe(
2433
2509
  });
2434
2510
  })
2435
2511
  );
2436
- var Flag$inboundSchema = z13.pipe(
2512
+ var Flag2$inboundSchema = z13.pipe(
2437
2513
  z13.object({
2438
2514
  id: string4(),
2439
2515
  plan_id: nullable(string4()),
2440
2516
  expires_at: nullable(number2()),
2441
2517
  feature_id: string4(),
2442
- feature: optional2(z13.lazy(() => CheckFeature$inboundSchema))
2518
+ feature: optional2(z13.lazy(() => CheckFeature2$inboundSchema))
2443
2519
  }),
2444
2520
  z13.transform((v) => {
2445
2521
  return remap(v, {
@@ -2449,15 +2525,15 @@ var Flag$inboundSchema = z13.pipe(
2449
2525
  });
2450
2526
  })
2451
2527
  );
2452
- var Scenario$inboundSchema = inboundSchema(Scenario);
2453
- var CheckEnv$inboundSchema = inboundSchema(CheckEnv);
2454
- var ProductType$inboundSchema = inboundSchema(ProductType);
2455
- var FeatureType$inboundSchema = inboundSchema(FeatureType);
2456
- var IncludedUsage$inboundSchema = smartUnion([number2(), string4()]);
2457
- var CheckInterval$inboundSchema = inboundSchema(CheckInterval);
2458
- var CheckTierBehavior$inboundSchema = inboundSchema(CheckTierBehavior);
2459
- var UsageModel$inboundSchema = inboundSchema(UsageModel);
2460
- var ProductDisplay$inboundSchema = z13.pipe(
2528
+ var Scenario2$inboundSchema = inboundSchema(Scenario2);
2529
+ var CheckEnv2$inboundSchema = inboundSchema(CheckEnv2);
2530
+ var ProductType2$inboundSchema = inboundSchema(ProductType2);
2531
+ var FeatureType2$inboundSchema = inboundSchema(FeatureType2);
2532
+ var IncludedUsage2$inboundSchema = smartUnion([number2(), string4()]);
2533
+ var CheckInterval2$inboundSchema = inboundSchema(CheckInterval2);
2534
+ var CheckTierBehavior2$inboundSchema = inboundSchema(CheckTierBehavior2);
2535
+ var UsageModel2$inboundSchema = inboundSchema(UsageModel2);
2536
+ var ProductDisplay2$inboundSchema = z13.pipe(
2461
2537
  z13.object({
2462
2538
  primary_text: string4(),
2463
2539
  secondary_text: z13.optional(z13.nullable(string4()))
@@ -2469,12 +2545,12 @@ var ProductDisplay$inboundSchema = z13.pipe(
2469
2545
  });
2470
2546
  })
2471
2547
  );
2472
- var ConfigDuration$inboundSchema = inboundSchema(ConfigDuration);
2473
- var CheckRollover$inboundSchema = z13.pipe(
2548
+ var ConfigDuration2$inboundSchema = inboundSchema(ConfigDuration2);
2549
+ var CheckRollover2$inboundSchema = z13.pipe(
2474
2550
  z13.object({
2475
2551
  max: z13.optional(z13.nullable(number2())),
2476
2552
  max_percentage: z13.optional(z13.nullable(number2())),
2477
- duration: z13._default(ConfigDuration$inboundSchema, "month"),
2553
+ duration: z13._default(ConfigDuration2$inboundSchema, "month"),
2478
2554
  length: number2()
2479
2555
  }),
2480
2556
  z13.transform((v) => {
@@ -2483,15 +2559,15 @@ var CheckRollover$inboundSchema = z13.pipe(
2483
2559
  });
2484
2560
  })
2485
2561
  );
2486
- var CheckOnIncrease$inboundSchema = inboundSchema(CheckOnIncrease);
2487
- var CheckOnDecrease$inboundSchema = inboundSchema(CheckOnDecrease);
2488
- var CheckConfig$inboundSchema = z13.pipe(
2562
+ var CheckOnIncrease2$inboundSchema = inboundSchema(CheckOnIncrease2);
2563
+ var CheckOnDecrease2$inboundSchema = inboundSchema(CheckOnDecrease2);
2564
+ var CheckConfig2$inboundSchema = z13.pipe(
2489
2565
  z13.object({
2490
2566
  rollover: z13.optional(
2491
- z13.nullable(z13.lazy(() => CheckRollover$inboundSchema))
2567
+ z13.nullable(z13.lazy(() => CheckRollover2$inboundSchema))
2492
2568
  ),
2493
- on_increase: z13.optional(z13.nullable(CheckOnIncrease$inboundSchema)),
2494
- on_decrease: z13.optional(z13.nullable(CheckOnDecrease$inboundSchema))
2569
+ on_increase: z13.optional(z13.nullable(CheckOnIncrease2$inboundSchema)),
2570
+ on_decrease: z13.optional(z13.nullable(CheckOnDecrease2$inboundSchema))
2495
2571
  }),
2496
2572
  z13.transform((v) => {
2497
2573
  return remap(v, {
@@ -2500,29 +2576,29 @@ var CheckConfig$inboundSchema = z13.pipe(
2500
2576
  });
2501
2577
  })
2502
2578
  );
2503
- var CheckItem$inboundSchema = z13.pipe(
2579
+ var CheckItem2$inboundSchema = z13.pipe(
2504
2580
  z13.object({
2505
- type: z13.optional(z13.nullable(ProductType$inboundSchema)),
2581
+ type: z13.optional(z13.nullable(ProductType2$inboundSchema)),
2506
2582
  feature_id: z13.optional(z13.nullable(string4())),
2507
- feature_type: z13.optional(z13.nullable(FeatureType$inboundSchema)),
2583
+ feature_type: z13.optional(z13.nullable(FeatureType2$inboundSchema)),
2508
2584
  included_usage: z13.optional(
2509
2585
  z13.nullable(smartUnion([number2(), string4()]))
2510
2586
  ),
2511
- interval: z13.optional(z13.nullable(CheckInterval$inboundSchema)),
2587
+ interval: z13.optional(z13.nullable(CheckInterval2$inboundSchema)),
2512
2588
  interval_count: z13.optional(z13.nullable(number2())),
2513
2589
  price: z13.optional(z13.nullable(number2())),
2514
2590
  tiers: z13.optional(z13.nullable(z13.array(nullable(z13.any())))),
2515
- tier_behavior: z13.optional(z13.nullable(CheckTierBehavior$inboundSchema)),
2516
- usage_model: z13.optional(z13.nullable(UsageModel$inboundSchema)),
2591
+ tier_behavior: z13.optional(z13.nullable(CheckTierBehavior2$inboundSchema)),
2592
+ usage_model: z13.optional(z13.nullable(UsageModel2$inboundSchema)),
2517
2593
  billing_units: z13.optional(z13.nullable(number2())),
2518
2594
  reset_usage_when_enabled: z13.optional(z13.nullable(boolean2())),
2519
2595
  entity_feature_id: z13.optional(z13.nullable(string4())),
2520
2596
  display: z13.optional(
2521
- z13.nullable(z13.lazy(() => ProductDisplay$inboundSchema))
2597
+ z13.nullable(z13.lazy(() => ProductDisplay2$inboundSchema))
2522
2598
  ),
2523
2599
  quantity: z13.optional(z13.nullable(number2())),
2524
2600
  next_cycle_quantity: z13.optional(z13.nullable(number2())),
2525
- config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig$inboundSchema)))
2601
+ config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig2$inboundSchema)))
2526
2602
  }),
2527
2603
  z13.transform((v) => {
2528
2604
  return remap(v, {
@@ -2539,10 +2615,10 @@ var CheckItem$inboundSchema = z13.pipe(
2539
2615
  });
2540
2616
  })
2541
2617
  );
2542
- var FreeTrialDuration$inboundSchema = inboundSchema(FreeTrialDuration);
2543
- var CheckFreeTrial$inboundSchema = z13.pipe(
2618
+ var FreeTrialDuration2$inboundSchema = inboundSchema(FreeTrialDuration2);
2619
+ var CheckFreeTrial2$inboundSchema = z13.pipe(
2544
2620
  z13.object({
2545
- duration: FreeTrialDuration$inboundSchema,
2621
+ duration: FreeTrialDuration2$inboundSchema,
2546
2622
  length: number2(),
2547
2623
  unique_fingerprint: boolean2(),
2548
2624
  card_required: boolean2(),
@@ -2556,8 +2632,8 @@ var CheckFreeTrial$inboundSchema = z13.pipe(
2556
2632
  });
2557
2633
  })
2558
2634
  );
2559
- var ProductScenario$inboundSchema = inboundSchema(ProductScenario);
2560
- var Properties$inboundSchema = z13.pipe(
2635
+ var ProductScenario2$inboundSchema = inboundSchema(ProductScenario2);
2636
+ var Properties2$inboundSchema = z13.pipe(
2561
2637
  z13.object({
2562
2638
  is_free: boolean2(),
2563
2639
  is_one_off: boolean2(),
@@ -2574,22 +2650,22 @@ var Properties$inboundSchema = z13.pipe(
2574
2650
  });
2575
2651
  })
2576
2652
  );
2577
- var Product$inboundSchema = z13.pipe(
2653
+ var Product2$inboundSchema = z13.pipe(
2578
2654
  z13.object({
2579
2655
  id: string4(),
2580
2656
  name: string4(),
2581
2657
  group: nullable(string4()),
2582
- env: CheckEnv$inboundSchema,
2658
+ env: CheckEnv2$inboundSchema,
2583
2659
  is_add_on: boolean2(),
2584
2660
  is_default: boolean2(),
2585
2661
  archived: boolean2(),
2586
2662
  version: number2(),
2587
2663
  created_at: number2(),
2588
- items: z13.array(z13.lazy(() => CheckItem$inboundSchema)),
2589
- free_trial: nullable(z13.lazy(() => CheckFreeTrial$inboundSchema)),
2664
+ items: z13.array(z13.lazy(() => CheckItem2$inboundSchema)),
2665
+ free_trial: nullable(z13.lazy(() => CheckFreeTrial2$inboundSchema)),
2590
2666
  base_variant_id: nullable(string4()),
2591
- scenario: optional2(ProductScenario$inboundSchema),
2592
- properties: optional2(z13.lazy(() => Properties$inboundSchema))
2667
+ scenario: optional2(ProductScenario2$inboundSchema),
2668
+ properties: optional2(z13.lazy(() => Properties2$inboundSchema))
2593
2669
  }),
2594
2670
  z13.transform((v) => {
2595
2671
  return remap(v, {
@@ -2601,14 +2677,14 @@ var Product$inboundSchema = z13.pipe(
2601
2677
  });
2602
2678
  })
2603
2679
  );
2604
- var Preview$inboundSchema = z13.pipe(
2680
+ var Preview2$inboundSchema = z13.pipe(
2605
2681
  z13.object({
2606
- scenario: Scenario$inboundSchema,
2682
+ scenario: Scenario2$inboundSchema,
2607
2683
  title: string4(),
2608
2684
  message: string4(),
2609
2685
  feature_id: string4(),
2610
2686
  feature_name: string4(),
2611
- products: z13.array(z13.lazy(() => Product$inboundSchema))
2687
+ products: z13.array(z13.lazy(() => Product2$inboundSchema))
2612
2688
  }),
2613
2689
  z13.transform((v) => {
2614
2690
  return remap(v, {
@@ -2617,15 +2693,15 @@ var Preview$inboundSchema = z13.pipe(
2617
2693
  });
2618
2694
  })
2619
2695
  );
2620
- var CheckResponse$inboundSchema = z13.pipe(
2696
+ var CheckResponseBody2$inboundSchema = z13.pipe(
2621
2697
  z13.object({
2622
2698
  allowed: boolean2(),
2623
2699
  customer_id: string4(),
2624
2700
  entity_id: z13.optional(z13.nullable(string4())),
2625
2701
  required_balance: optional2(number2()),
2626
2702
  balance: nullable(Balance$inboundSchema),
2627
- flag: nullable(z13.lazy(() => Flag$inboundSchema)),
2628
- preview: optional2(z13.lazy(() => Preview$inboundSchema))
2703
+ flag: nullable(z13.lazy(() => Flag2$inboundSchema)),
2704
+ preview: optional2(z13.lazy(() => Preview2$inboundSchema))
2629
2705
  }),
2630
2706
  z13.transform((v) => {
2631
2707
  return remap(v, {
@@ -2635,6 +2711,249 @@ var CheckResponse$inboundSchema = z13.pipe(
2635
2711
  });
2636
2712
  })
2637
2713
  );
2714
+ var FlagType1$inboundSchema = inboundSchema(FlagType1);
2715
+ var CheckCreditSchema1$inboundSchema = z13.pipe(
2716
+ z13.object({
2717
+ metered_feature_id: string4(),
2718
+ credit_cost: number2()
2719
+ }),
2720
+ z13.transform((v) => {
2721
+ return remap(v, {
2722
+ "metered_feature_id": "meteredFeatureId",
2723
+ "credit_cost": "creditCost"
2724
+ });
2725
+ })
2726
+ );
2727
+ var FlagDisplay1$inboundSchema = z13.object({
2728
+ singular: z13.optional(z13.nullable(string4())),
2729
+ plural: z13.optional(z13.nullable(string4()))
2730
+ });
2731
+ var CheckFeature1$inboundSchema = z13.pipe(
2732
+ z13.object({
2733
+ id: string4(),
2734
+ name: string4(),
2735
+ type: FlagType1$inboundSchema,
2736
+ consumable: boolean2(),
2737
+ event_names: optional2(z13.array(string4())),
2738
+ credit_schema: optional2(
2739
+ z13.array(z13.lazy(() => CheckCreditSchema1$inboundSchema))
2740
+ ),
2741
+ display: optional2(z13.lazy(() => FlagDisplay1$inboundSchema)),
2742
+ archived: boolean2()
2743
+ }),
2744
+ z13.transform((v) => {
2745
+ return remap(v, {
2746
+ "event_names": "eventNames",
2747
+ "credit_schema": "creditSchema"
2748
+ });
2749
+ })
2750
+ );
2751
+ var Flag1$inboundSchema = z13.pipe(
2752
+ z13.object({
2753
+ id: string4(),
2754
+ plan_id: nullable(string4()),
2755
+ expires_at: nullable(number2()),
2756
+ feature_id: string4(),
2757
+ feature: optional2(z13.lazy(() => CheckFeature1$inboundSchema))
2758
+ }),
2759
+ z13.transform((v) => {
2760
+ return remap(v, {
2761
+ "plan_id": "planId",
2762
+ "expires_at": "expiresAt",
2763
+ "feature_id": "featureId"
2764
+ });
2765
+ })
2766
+ );
2767
+ var Scenario1$inboundSchema = inboundSchema(Scenario1);
2768
+ var CheckEnv1$inboundSchema = inboundSchema(CheckEnv1);
2769
+ var ProductType1$inboundSchema = inboundSchema(ProductType1);
2770
+ var FeatureType1$inboundSchema = inboundSchema(FeatureType1);
2771
+ var IncludedUsage1$inboundSchema = smartUnion([number2(), string4()]);
2772
+ var CheckInterval1$inboundSchema = inboundSchema(CheckInterval1);
2773
+ var CheckTierBehavior1$inboundSchema = inboundSchema(CheckTierBehavior1);
2774
+ var UsageModel1$inboundSchema = inboundSchema(UsageModel1);
2775
+ var ProductDisplay1$inboundSchema = z13.pipe(
2776
+ z13.object({
2777
+ primary_text: string4(),
2778
+ secondary_text: z13.optional(z13.nullable(string4()))
2779
+ }),
2780
+ z13.transform((v) => {
2781
+ return remap(v, {
2782
+ "primary_text": "primaryText",
2783
+ "secondary_text": "secondaryText"
2784
+ });
2785
+ })
2786
+ );
2787
+ var ConfigDuration1$inboundSchema = inboundSchema(ConfigDuration1);
2788
+ var CheckRollover1$inboundSchema = z13.pipe(
2789
+ z13.object({
2790
+ max: z13.optional(z13.nullable(number2())),
2791
+ max_percentage: z13.optional(z13.nullable(number2())),
2792
+ duration: z13._default(ConfigDuration1$inboundSchema, "month"),
2793
+ length: number2()
2794
+ }),
2795
+ z13.transform((v) => {
2796
+ return remap(v, {
2797
+ "max_percentage": "maxPercentage"
2798
+ });
2799
+ })
2800
+ );
2801
+ var CheckOnIncrease1$inboundSchema = inboundSchema(CheckOnIncrease1);
2802
+ var CheckOnDecrease1$inboundSchema = inboundSchema(CheckOnDecrease1);
2803
+ var CheckConfig1$inboundSchema = z13.pipe(
2804
+ z13.object({
2805
+ rollover: z13.optional(
2806
+ z13.nullable(z13.lazy(() => CheckRollover1$inboundSchema))
2807
+ ),
2808
+ on_increase: z13.optional(z13.nullable(CheckOnIncrease1$inboundSchema)),
2809
+ on_decrease: z13.optional(z13.nullable(CheckOnDecrease1$inboundSchema))
2810
+ }),
2811
+ z13.transform((v) => {
2812
+ return remap(v, {
2813
+ "on_increase": "onIncrease",
2814
+ "on_decrease": "onDecrease"
2815
+ });
2816
+ })
2817
+ );
2818
+ var CheckItem1$inboundSchema = z13.pipe(
2819
+ z13.object({
2820
+ type: z13.optional(z13.nullable(ProductType1$inboundSchema)),
2821
+ feature_id: z13.optional(z13.nullable(string4())),
2822
+ feature_type: z13.optional(z13.nullable(FeatureType1$inboundSchema)),
2823
+ included_usage: z13.optional(
2824
+ z13.nullable(smartUnion([number2(), string4()]))
2825
+ ),
2826
+ interval: z13.optional(z13.nullable(CheckInterval1$inboundSchema)),
2827
+ interval_count: z13.optional(z13.nullable(number2())),
2828
+ price: z13.optional(z13.nullable(number2())),
2829
+ tiers: z13.optional(z13.nullable(z13.array(nullable(z13.any())))),
2830
+ tier_behavior: z13.optional(z13.nullable(CheckTierBehavior1$inboundSchema)),
2831
+ usage_model: z13.optional(z13.nullable(UsageModel1$inboundSchema)),
2832
+ billing_units: z13.optional(z13.nullable(number2())),
2833
+ reset_usage_when_enabled: z13.optional(z13.nullable(boolean2())),
2834
+ entity_feature_id: z13.optional(z13.nullable(string4())),
2835
+ display: z13.optional(
2836
+ z13.nullable(z13.lazy(() => ProductDisplay1$inboundSchema))
2837
+ ),
2838
+ quantity: z13.optional(z13.nullable(number2())),
2839
+ next_cycle_quantity: z13.optional(z13.nullable(number2())),
2840
+ config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig1$inboundSchema)))
2841
+ }),
2842
+ z13.transform((v) => {
2843
+ return remap(v, {
2844
+ "feature_id": "featureId",
2845
+ "feature_type": "featureType",
2846
+ "included_usage": "includedUsage",
2847
+ "interval_count": "intervalCount",
2848
+ "tier_behavior": "tierBehavior",
2849
+ "usage_model": "usageModel",
2850
+ "billing_units": "billingUnits",
2851
+ "reset_usage_when_enabled": "resetUsageWhenEnabled",
2852
+ "entity_feature_id": "entityFeatureId",
2853
+ "next_cycle_quantity": "nextCycleQuantity"
2854
+ });
2855
+ })
2856
+ );
2857
+ var FreeTrialDuration1$inboundSchema = inboundSchema(FreeTrialDuration1);
2858
+ var CheckFreeTrial1$inboundSchema = z13.pipe(
2859
+ z13.object({
2860
+ duration: FreeTrialDuration1$inboundSchema,
2861
+ length: number2(),
2862
+ unique_fingerprint: boolean2(),
2863
+ card_required: boolean2(),
2864
+ trial_available: z13.nullable(z13._default(boolean2(), true))
2865
+ }),
2866
+ z13.transform((v) => {
2867
+ return remap(v, {
2868
+ "unique_fingerprint": "uniqueFingerprint",
2869
+ "card_required": "cardRequired",
2870
+ "trial_available": "trialAvailable"
2871
+ });
2872
+ })
2873
+ );
2874
+ var ProductScenario1$inboundSchema = inboundSchema(ProductScenario1);
2875
+ var Properties1$inboundSchema = z13.pipe(
2876
+ z13.object({
2877
+ is_free: boolean2(),
2878
+ is_one_off: boolean2(),
2879
+ interval_group: z13.optional(z13.nullable(string4())),
2880
+ has_trial: z13.optional(z13.nullable(boolean2())),
2881
+ updateable: z13.optional(z13.nullable(boolean2()))
2882
+ }),
2883
+ z13.transform((v) => {
2884
+ return remap(v, {
2885
+ "is_free": "isFree",
2886
+ "is_one_off": "isOneOff",
2887
+ "interval_group": "intervalGroup",
2888
+ "has_trial": "hasTrial"
2889
+ });
2890
+ })
2891
+ );
2892
+ var Product1$inboundSchema = z13.pipe(
2893
+ z13.object({
2894
+ id: string4(),
2895
+ name: string4(),
2896
+ group: nullable(string4()),
2897
+ env: CheckEnv1$inboundSchema,
2898
+ is_add_on: boolean2(),
2899
+ is_default: boolean2(),
2900
+ archived: boolean2(),
2901
+ version: number2(),
2902
+ created_at: number2(),
2903
+ items: z13.array(z13.lazy(() => CheckItem1$inboundSchema)),
2904
+ free_trial: nullable(z13.lazy(() => CheckFreeTrial1$inboundSchema)),
2905
+ base_variant_id: nullable(string4()),
2906
+ scenario: optional2(ProductScenario1$inboundSchema),
2907
+ properties: optional2(z13.lazy(() => Properties1$inboundSchema))
2908
+ }),
2909
+ z13.transform((v) => {
2910
+ return remap(v, {
2911
+ "is_add_on": "isAddOn",
2912
+ "is_default": "isDefault",
2913
+ "created_at": "createdAt",
2914
+ "free_trial": "freeTrial",
2915
+ "base_variant_id": "baseVariantId"
2916
+ });
2917
+ })
2918
+ );
2919
+ var Preview1$inboundSchema = z13.pipe(
2920
+ z13.object({
2921
+ scenario: Scenario1$inboundSchema,
2922
+ title: string4(),
2923
+ message: string4(),
2924
+ feature_id: string4(),
2925
+ feature_name: string4(),
2926
+ products: z13.array(z13.lazy(() => Product1$inboundSchema))
2927
+ }),
2928
+ z13.transform((v) => {
2929
+ return remap(v, {
2930
+ "feature_id": "featureId",
2931
+ "feature_name": "featureName"
2932
+ });
2933
+ })
2934
+ );
2935
+ var CheckResponseBody1$inboundSchema = z13.pipe(
2936
+ z13.object({
2937
+ allowed: boolean2(),
2938
+ customer_id: string4(),
2939
+ entity_id: z13.optional(z13.nullable(string4())),
2940
+ required_balance: optional2(number2()),
2941
+ balance: nullable(Balance$inboundSchema),
2942
+ flag: nullable(z13.lazy(() => Flag1$inboundSchema)),
2943
+ preview: optional2(z13.lazy(() => Preview1$inboundSchema))
2944
+ }),
2945
+ z13.transform((v) => {
2946
+ return remap(v, {
2947
+ "customer_id": "customerId",
2948
+ "entity_id": "entityId",
2949
+ "required_balance": "requiredBalance"
2950
+ });
2951
+ })
2952
+ );
2953
+ var CheckResponse$inboundSchema = smartUnion([
2954
+ z13.lazy(() => CheckResponseBody1$inboundSchema),
2955
+ z13.lazy(() => CheckResponseBody2$inboundSchema)
2956
+ ]);
2638
2957
 
2639
2958
  // ../sdk/src/models/create-balance-op.ts
2640
2959
  var z14 = __toESM(require("zod/v4-mini"), 1);
@@ -4609,9 +4928,16 @@ var FinalizeBalanceParams$outboundSchema = z27.pipe(
4609
4928
  });
4610
4929
  })
4611
4930
  );
4612
- var FinalizeLockResponse$inboundSchema = z27.object({
4931
+ var FinalizeLockResponseBody2$inboundSchema = z27.object({
4613
4932
  success: boolean2()
4614
4933
  });
4934
+ var FinalizeLockResponseBody1$inboundSchema = z27.object({
4935
+ success: boolean2()
4936
+ });
4937
+ var FinalizeLockResponse$inboundSchema = smartUnion([
4938
+ z27.lazy(() => FinalizeLockResponseBody1$inboundSchema),
4939
+ z27.lazy(() => FinalizeLockResponseBody2$inboundSchema)
4940
+ ]);
4615
4941
 
4616
4942
  // ../sdk/src/models/get-entity-op.ts
4617
4943
  var z28 = __toESM(require("zod/v4-mini"), 1);
@@ -8647,7 +8973,7 @@ var TrackParams$outboundSchema = z43.pipe(
8647
8973
  });
8648
8974
  })
8649
8975
  );
8650
- var TrackResponse$inboundSchema = z43.pipe(
8976
+ var TrackResponseBody2$inboundSchema = z43.pipe(
8651
8977
  z43.object({
8652
8978
  customer_id: string4(),
8653
8979
  entity_id: optional2(string4()),
@@ -8664,6 +8990,27 @@ var TrackResponse$inboundSchema = z43.pipe(
8664
8990
  });
8665
8991
  })
8666
8992
  );
8993
+ var TrackResponseBody1$inboundSchema = z43.pipe(
8994
+ z43.object({
8995
+ customer_id: string4(),
8996
+ entity_id: optional2(string4()),
8997
+ event_name: optional2(string4()),
8998
+ value: number2(),
8999
+ balance: nullable(Balance$inboundSchema),
9000
+ balances: optional2(z43.record(z43.string(), Balance$inboundSchema))
9001
+ }),
9002
+ z43.transform((v) => {
9003
+ return remap(v, {
9004
+ "customer_id": "customerId",
9005
+ "entity_id": "entityId",
9006
+ "event_name": "eventName"
9007
+ });
9008
+ })
9009
+ );
9010
+ var TrackResponse$inboundSchema = smartUnion([
9011
+ z43.lazy(() => TrackResponseBody1$inboundSchema),
9012
+ z43.lazy(() => TrackResponseBody2$inboundSchema)
9013
+ ]);
8667
9014
 
8668
9015
  // ../sdk/src/models/update-balance-op.ts
8669
9016
  var z44 = __toESM(require("zod/v4-mini"), 1);
@@ -10148,6 +10495,7 @@ async function $do(client, request, options) {
10148
10495
  const response = doResult.value;
10149
10496
  const [result] = await match(
10150
10497
  json(200, CheckResponse$inboundSchema),
10498
+ json(202, CheckResponse$inboundSchema),
10151
10499
  fail("4XX"),
10152
10500
  fail("5XX")
10153
10501
  )(response, req);
@@ -10226,6 +10574,7 @@ async function $do2(client, request, options) {
10226
10574
  const response = doResult.value;
10227
10575
  const [result] = await match(
10228
10576
  json(200, TrackResponse$inboundSchema),
10577
+ json(202, TrackResponse$inboundSchema),
10229
10578
  fail("4XX"),
10230
10579
  fail("5XX")
10231
10580
  )(response, req);
@@ -11065,6 +11414,7 @@ async function $do5(client, request, options) {
11065
11414
  const response = doResult.value;
11066
11415
  const [result] = await match(
11067
11416
  json(200, FinalizeLockResponse$inboundSchema),
11417
+ json(202, FinalizeLockResponse$inboundSchema),
11068
11418
  fail("4XX"),
11069
11419
  fail("5XX")
11070
11420
  )(response, req);
@@ -14463,7 +14813,7 @@ var Autumn = class extends ClientSDK {
14463
14813
  * @param lock - Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold. (optional)
14464
14814
  * @param withPreview - If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls. (optional)
14465
14815
  *
14466
- * @returns Whether access is allowed, plus the current balance for that feature.
14816
+ * @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.
14467
14817
  */
14468
14818
  async check(request, options) {
14469
14819
  return unwrapAsync(check(
@@ -14496,7 +14846,7 @@ var Autumn = class extends ClientSDK {
14496
14846
  * @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
14497
14847
  * @param properties - Additional properties to attach to this usage event. (optional)
14498
14848
  *
14499
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances.
14849
+ * @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.
14500
14850
  */
14501
14851
  async track(request, options) {
14502
14852
  return unwrapAsync(track(