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