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