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
@@ -2264,31 +2264,31 @@ var BillingUpdateResponse$inboundSchema = z12.pipe(
2264
2264
 
2265
2265
  // ../sdk/src/models/check-op.ts
2266
2266
  import * as z13 from "zod/v4-mini";
2267
- var FlagType = {
2267
+ var FlagType2 = {
2268
2268
  Boolean: "boolean",
2269
2269
  Metered: "metered",
2270
2270
  CreditSystem: "credit_system"
2271
2271
  };
2272
- var Scenario = {
2272
+ var Scenario2 = {
2273
2273
  UsageLimit: "usage_limit",
2274
2274
  FeatureFlag: "feature_flag"
2275
2275
  };
2276
- var CheckEnv = {
2276
+ var CheckEnv2 = {
2277
2277
  Sandbox: "sandbox",
2278
2278
  Live: "live"
2279
2279
  };
2280
- var ProductType = {
2280
+ var ProductType2 = {
2281
2281
  Feature: "feature",
2282
2282
  PricedFeature: "priced_feature",
2283
2283
  Price: "price"
2284
2284
  };
2285
- var FeatureType = {
2285
+ var FeatureType2 = {
2286
2286
  SingleUse: "single_use",
2287
2287
  ContinuousUse: "continuous_use",
2288
2288
  Boolean: "boolean",
2289
2289
  Static: "static"
2290
2290
  };
2291
- var CheckInterval = {
2291
+ var CheckInterval2 = {
2292
2292
  Minute: "minute",
2293
2293
  Hour: "hour",
2294
2294
  Day: "day",
@@ -2298,37 +2298,113 @@ var CheckInterval = {
2298
2298
  SemiAnnual: "semi_annual",
2299
2299
  Year: "year"
2300
2300
  };
2301
- var CheckTierBehavior = {
2301
+ var CheckTierBehavior2 = {
2302
2302
  Graduated: "graduated",
2303
2303
  Volume: "volume"
2304
2304
  };
2305
- var UsageModel = {
2305
+ var UsageModel2 = {
2306
2306
  Prepaid: "prepaid",
2307
2307
  PayPerUse: "pay_per_use"
2308
2308
  };
2309
- var ConfigDuration = {
2309
+ var ConfigDuration2 = {
2310
2310
  Month: "month",
2311
2311
  Forever: "forever"
2312
2312
  };
2313
- var CheckOnIncrease = {
2313
+ var CheckOnIncrease2 = {
2314
2314
  BillImmediately: "bill_immediately",
2315
2315
  ProrateImmediately: "prorate_immediately",
2316
2316
  ProrateNextCycle: "prorate_next_cycle",
2317
2317
  BillNextCycle: "bill_next_cycle"
2318
2318
  };
2319
- var CheckOnDecrease = {
2319
+ var CheckOnDecrease2 = {
2320
2320
  Prorate: "prorate",
2321
2321
  ProrateImmediately: "prorate_immediately",
2322
2322
  ProrateNextCycle: "prorate_next_cycle",
2323
2323
  None: "none",
2324
2324
  NoProrations: "no_prorations"
2325
2325
  };
2326
- var FreeTrialDuration = {
2326
+ var FreeTrialDuration2 = {
2327
2327
  Day: "day",
2328
2328
  Month: "month",
2329
2329
  Year: "year"
2330
2330
  };
2331
- var ProductScenario = {
2331
+ var ProductScenario2 = {
2332
+ Scheduled: "scheduled",
2333
+ Active: "active",
2334
+ New: "new",
2335
+ Renew: "renew",
2336
+ Upgrade: "upgrade",
2337
+ UpdatePrepaidQuantity: "update_prepaid_quantity",
2338
+ Downgrade: "downgrade",
2339
+ Cancel: "cancel",
2340
+ Expired: "expired",
2341
+ PastDue: "past_due"
2342
+ };
2343
+ var FlagType1 = {
2344
+ Boolean: "boolean",
2345
+ Metered: "metered",
2346
+ CreditSystem: "credit_system"
2347
+ };
2348
+ var Scenario1 = {
2349
+ UsageLimit: "usage_limit",
2350
+ FeatureFlag: "feature_flag"
2351
+ };
2352
+ var CheckEnv1 = {
2353
+ Sandbox: "sandbox",
2354
+ Live: "live"
2355
+ };
2356
+ var ProductType1 = {
2357
+ Feature: "feature",
2358
+ PricedFeature: "priced_feature",
2359
+ Price: "price"
2360
+ };
2361
+ var FeatureType1 = {
2362
+ SingleUse: "single_use",
2363
+ ContinuousUse: "continuous_use",
2364
+ Boolean: "boolean",
2365
+ Static: "static"
2366
+ };
2367
+ var CheckInterval1 = {
2368
+ Minute: "minute",
2369
+ Hour: "hour",
2370
+ Day: "day",
2371
+ Week: "week",
2372
+ Month: "month",
2373
+ Quarter: "quarter",
2374
+ SemiAnnual: "semi_annual",
2375
+ Year: "year"
2376
+ };
2377
+ var CheckTierBehavior1 = {
2378
+ Graduated: "graduated",
2379
+ Volume: "volume"
2380
+ };
2381
+ var UsageModel1 = {
2382
+ Prepaid: "prepaid",
2383
+ PayPerUse: "pay_per_use"
2384
+ };
2385
+ var ConfigDuration1 = {
2386
+ Month: "month",
2387
+ Forever: "forever"
2388
+ };
2389
+ var CheckOnIncrease1 = {
2390
+ BillImmediately: "bill_immediately",
2391
+ ProrateImmediately: "prorate_immediately",
2392
+ ProrateNextCycle: "prorate_next_cycle",
2393
+ BillNextCycle: "bill_next_cycle"
2394
+ };
2395
+ var CheckOnDecrease1 = {
2396
+ Prorate: "prorate",
2397
+ ProrateImmediately: "prorate_immediately",
2398
+ ProrateNextCycle: "prorate_next_cycle",
2399
+ None: "none",
2400
+ NoProrations: "no_prorations"
2401
+ };
2402
+ var FreeTrialDuration1 = {
2403
+ Day: "day",
2404
+ Month: "month",
2405
+ Year: "year"
2406
+ };
2407
+ var ProductScenario1 = {
2332
2408
  Scheduled: "scheduled",
2333
2409
  Active: "active",
2334
2410
  New: "new",
@@ -2375,8 +2451,8 @@ var CheckParams$outboundSchema = z13.pipe(
2375
2451
  });
2376
2452
  })
2377
2453
  );
2378
- var FlagType$inboundSchema = inboundSchema(FlagType);
2379
- var CheckCreditSchema$inboundSchema = z13.pipe(
2454
+ var FlagType2$inboundSchema = inboundSchema(FlagType2);
2455
+ var CheckCreditSchema2$inboundSchema = z13.pipe(
2380
2456
  z13.object({
2381
2457
  metered_feature_id: string4(),
2382
2458
  credit_cost: number2()
@@ -2388,21 +2464,21 @@ var CheckCreditSchema$inboundSchema = z13.pipe(
2388
2464
  });
2389
2465
  })
2390
2466
  );
2391
- var FlagDisplay$inboundSchema = z13.object({
2467
+ var FlagDisplay2$inboundSchema = z13.object({
2392
2468
  singular: z13.optional(z13.nullable(string4())),
2393
2469
  plural: z13.optional(z13.nullable(string4()))
2394
2470
  });
2395
- var CheckFeature$inboundSchema = z13.pipe(
2471
+ var CheckFeature2$inboundSchema = z13.pipe(
2396
2472
  z13.object({
2397
2473
  id: string4(),
2398
2474
  name: string4(),
2399
- type: FlagType$inboundSchema,
2475
+ type: FlagType2$inboundSchema,
2400
2476
  consumable: boolean2(),
2401
2477
  event_names: optional2(z13.array(string4())),
2402
2478
  credit_schema: optional2(
2403
- z13.array(z13.lazy(() => CheckCreditSchema$inboundSchema))
2479
+ z13.array(z13.lazy(() => CheckCreditSchema2$inboundSchema))
2404
2480
  ),
2405
- display: optional2(z13.lazy(() => FlagDisplay$inboundSchema)),
2481
+ display: optional2(z13.lazy(() => FlagDisplay2$inboundSchema)),
2406
2482
  archived: boolean2()
2407
2483
  }),
2408
2484
  z13.transform((v) => {
@@ -2412,13 +2488,13 @@ var CheckFeature$inboundSchema = z13.pipe(
2412
2488
  });
2413
2489
  })
2414
2490
  );
2415
- var Flag$inboundSchema = z13.pipe(
2491
+ var Flag2$inboundSchema = z13.pipe(
2416
2492
  z13.object({
2417
2493
  id: string4(),
2418
2494
  plan_id: nullable(string4()),
2419
2495
  expires_at: nullable(number2()),
2420
2496
  feature_id: string4(),
2421
- feature: optional2(z13.lazy(() => CheckFeature$inboundSchema))
2497
+ feature: optional2(z13.lazy(() => CheckFeature2$inboundSchema))
2422
2498
  }),
2423
2499
  z13.transform((v) => {
2424
2500
  return remap(v, {
@@ -2428,15 +2504,15 @@ var Flag$inboundSchema = z13.pipe(
2428
2504
  });
2429
2505
  })
2430
2506
  );
2431
- var Scenario$inboundSchema = inboundSchema(Scenario);
2432
- var CheckEnv$inboundSchema = inboundSchema(CheckEnv);
2433
- var ProductType$inboundSchema = inboundSchema(ProductType);
2434
- var FeatureType$inboundSchema = inboundSchema(FeatureType);
2435
- var IncludedUsage$inboundSchema = smartUnion([number2(), string4()]);
2436
- var CheckInterval$inboundSchema = inboundSchema(CheckInterval);
2437
- var CheckTierBehavior$inboundSchema = inboundSchema(CheckTierBehavior);
2438
- var UsageModel$inboundSchema = inboundSchema(UsageModel);
2439
- var ProductDisplay$inboundSchema = z13.pipe(
2507
+ var Scenario2$inboundSchema = inboundSchema(Scenario2);
2508
+ var CheckEnv2$inboundSchema = inboundSchema(CheckEnv2);
2509
+ var ProductType2$inboundSchema = inboundSchema(ProductType2);
2510
+ var FeatureType2$inboundSchema = inboundSchema(FeatureType2);
2511
+ var IncludedUsage2$inboundSchema = smartUnion([number2(), string4()]);
2512
+ var CheckInterval2$inboundSchema = inboundSchema(CheckInterval2);
2513
+ var CheckTierBehavior2$inboundSchema = inboundSchema(CheckTierBehavior2);
2514
+ var UsageModel2$inboundSchema = inboundSchema(UsageModel2);
2515
+ var ProductDisplay2$inboundSchema = z13.pipe(
2440
2516
  z13.object({
2441
2517
  primary_text: string4(),
2442
2518
  secondary_text: z13.optional(z13.nullable(string4()))
@@ -2448,12 +2524,12 @@ var ProductDisplay$inboundSchema = z13.pipe(
2448
2524
  });
2449
2525
  })
2450
2526
  );
2451
- var ConfigDuration$inboundSchema = inboundSchema(ConfigDuration);
2452
- var CheckRollover$inboundSchema = z13.pipe(
2527
+ var ConfigDuration2$inboundSchema = inboundSchema(ConfigDuration2);
2528
+ var CheckRollover2$inboundSchema = z13.pipe(
2453
2529
  z13.object({
2454
2530
  max: z13.optional(z13.nullable(number2())),
2455
2531
  max_percentage: z13.optional(z13.nullable(number2())),
2456
- duration: z13._default(ConfigDuration$inboundSchema, "month"),
2532
+ duration: z13._default(ConfigDuration2$inboundSchema, "month"),
2457
2533
  length: number2()
2458
2534
  }),
2459
2535
  z13.transform((v) => {
@@ -2462,15 +2538,15 @@ var CheckRollover$inboundSchema = z13.pipe(
2462
2538
  });
2463
2539
  })
2464
2540
  );
2465
- var CheckOnIncrease$inboundSchema = inboundSchema(CheckOnIncrease);
2466
- var CheckOnDecrease$inboundSchema = inboundSchema(CheckOnDecrease);
2467
- var CheckConfig$inboundSchema = z13.pipe(
2541
+ var CheckOnIncrease2$inboundSchema = inboundSchema(CheckOnIncrease2);
2542
+ var CheckOnDecrease2$inboundSchema = inboundSchema(CheckOnDecrease2);
2543
+ var CheckConfig2$inboundSchema = z13.pipe(
2468
2544
  z13.object({
2469
2545
  rollover: z13.optional(
2470
- z13.nullable(z13.lazy(() => CheckRollover$inboundSchema))
2546
+ z13.nullable(z13.lazy(() => CheckRollover2$inboundSchema))
2471
2547
  ),
2472
- on_increase: z13.optional(z13.nullable(CheckOnIncrease$inboundSchema)),
2473
- on_decrease: z13.optional(z13.nullable(CheckOnDecrease$inboundSchema))
2548
+ on_increase: z13.optional(z13.nullable(CheckOnIncrease2$inboundSchema)),
2549
+ on_decrease: z13.optional(z13.nullable(CheckOnDecrease2$inboundSchema))
2474
2550
  }),
2475
2551
  z13.transform((v) => {
2476
2552
  return remap(v, {
@@ -2479,29 +2555,29 @@ var CheckConfig$inboundSchema = z13.pipe(
2479
2555
  });
2480
2556
  })
2481
2557
  );
2482
- var CheckItem$inboundSchema = z13.pipe(
2558
+ var CheckItem2$inboundSchema = z13.pipe(
2483
2559
  z13.object({
2484
- type: z13.optional(z13.nullable(ProductType$inboundSchema)),
2560
+ type: z13.optional(z13.nullable(ProductType2$inboundSchema)),
2485
2561
  feature_id: z13.optional(z13.nullable(string4())),
2486
- feature_type: z13.optional(z13.nullable(FeatureType$inboundSchema)),
2562
+ feature_type: z13.optional(z13.nullable(FeatureType2$inboundSchema)),
2487
2563
  included_usage: z13.optional(
2488
2564
  z13.nullable(smartUnion([number2(), string4()]))
2489
2565
  ),
2490
- interval: z13.optional(z13.nullable(CheckInterval$inboundSchema)),
2566
+ interval: z13.optional(z13.nullable(CheckInterval2$inboundSchema)),
2491
2567
  interval_count: z13.optional(z13.nullable(number2())),
2492
2568
  price: z13.optional(z13.nullable(number2())),
2493
2569
  tiers: z13.optional(z13.nullable(z13.array(nullable(z13.any())))),
2494
- tier_behavior: z13.optional(z13.nullable(CheckTierBehavior$inboundSchema)),
2495
- usage_model: z13.optional(z13.nullable(UsageModel$inboundSchema)),
2570
+ tier_behavior: z13.optional(z13.nullable(CheckTierBehavior2$inboundSchema)),
2571
+ usage_model: z13.optional(z13.nullable(UsageModel2$inboundSchema)),
2496
2572
  billing_units: z13.optional(z13.nullable(number2())),
2497
2573
  reset_usage_when_enabled: z13.optional(z13.nullable(boolean2())),
2498
2574
  entity_feature_id: z13.optional(z13.nullable(string4())),
2499
2575
  display: z13.optional(
2500
- z13.nullable(z13.lazy(() => ProductDisplay$inboundSchema))
2576
+ z13.nullable(z13.lazy(() => ProductDisplay2$inboundSchema))
2501
2577
  ),
2502
2578
  quantity: z13.optional(z13.nullable(number2())),
2503
2579
  next_cycle_quantity: z13.optional(z13.nullable(number2())),
2504
- config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig$inboundSchema)))
2580
+ config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig2$inboundSchema)))
2505
2581
  }),
2506
2582
  z13.transform((v) => {
2507
2583
  return remap(v, {
@@ -2518,10 +2594,10 @@ var CheckItem$inboundSchema = z13.pipe(
2518
2594
  });
2519
2595
  })
2520
2596
  );
2521
- var FreeTrialDuration$inboundSchema = inboundSchema(FreeTrialDuration);
2522
- var CheckFreeTrial$inboundSchema = z13.pipe(
2597
+ var FreeTrialDuration2$inboundSchema = inboundSchema(FreeTrialDuration2);
2598
+ var CheckFreeTrial2$inboundSchema = z13.pipe(
2523
2599
  z13.object({
2524
- duration: FreeTrialDuration$inboundSchema,
2600
+ duration: FreeTrialDuration2$inboundSchema,
2525
2601
  length: number2(),
2526
2602
  unique_fingerprint: boolean2(),
2527
2603
  card_required: boolean2(),
@@ -2535,8 +2611,8 @@ var CheckFreeTrial$inboundSchema = z13.pipe(
2535
2611
  });
2536
2612
  })
2537
2613
  );
2538
- var ProductScenario$inboundSchema = inboundSchema(ProductScenario);
2539
- var Properties$inboundSchema = z13.pipe(
2614
+ var ProductScenario2$inboundSchema = inboundSchema(ProductScenario2);
2615
+ var Properties2$inboundSchema = z13.pipe(
2540
2616
  z13.object({
2541
2617
  is_free: boolean2(),
2542
2618
  is_one_off: boolean2(),
@@ -2553,22 +2629,22 @@ var Properties$inboundSchema = z13.pipe(
2553
2629
  });
2554
2630
  })
2555
2631
  );
2556
- var Product$inboundSchema = z13.pipe(
2632
+ var Product2$inboundSchema = z13.pipe(
2557
2633
  z13.object({
2558
2634
  id: string4(),
2559
2635
  name: string4(),
2560
2636
  group: nullable(string4()),
2561
- env: CheckEnv$inboundSchema,
2637
+ env: CheckEnv2$inboundSchema,
2562
2638
  is_add_on: boolean2(),
2563
2639
  is_default: boolean2(),
2564
2640
  archived: boolean2(),
2565
2641
  version: number2(),
2566
2642
  created_at: number2(),
2567
- items: z13.array(z13.lazy(() => CheckItem$inboundSchema)),
2568
- free_trial: nullable(z13.lazy(() => CheckFreeTrial$inboundSchema)),
2643
+ items: z13.array(z13.lazy(() => CheckItem2$inboundSchema)),
2644
+ free_trial: nullable(z13.lazy(() => CheckFreeTrial2$inboundSchema)),
2569
2645
  base_variant_id: nullable(string4()),
2570
- scenario: optional2(ProductScenario$inboundSchema),
2571
- properties: optional2(z13.lazy(() => Properties$inboundSchema))
2646
+ scenario: optional2(ProductScenario2$inboundSchema),
2647
+ properties: optional2(z13.lazy(() => Properties2$inboundSchema))
2572
2648
  }),
2573
2649
  z13.transform((v) => {
2574
2650
  return remap(v, {
@@ -2580,14 +2656,14 @@ var Product$inboundSchema = z13.pipe(
2580
2656
  });
2581
2657
  })
2582
2658
  );
2583
- var Preview$inboundSchema = z13.pipe(
2659
+ var Preview2$inboundSchema = z13.pipe(
2584
2660
  z13.object({
2585
- scenario: Scenario$inboundSchema,
2661
+ scenario: Scenario2$inboundSchema,
2586
2662
  title: string4(),
2587
2663
  message: string4(),
2588
2664
  feature_id: string4(),
2589
2665
  feature_name: string4(),
2590
- products: z13.array(z13.lazy(() => Product$inboundSchema))
2666
+ products: z13.array(z13.lazy(() => Product2$inboundSchema))
2591
2667
  }),
2592
2668
  z13.transform((v) => {
2593
2669
  return remap(v, {
@@ -2596,15 +2672,15 @@ var Preview$inboundSchema = z13.pipe(
2596
2672
  });
2597
2673
  })
2598
2674
  );
2599
- var CheckResponse$inboundSchema = z13.pipe(
2675
+ var CheckResponseBody2$inboundSchema = z13.pipe(
2600
2676
  z13.object({
2601
2677
  allowed: boolean2(),
2602
2678
  customer_id: string4(),
2603
2679
  entity_id: z13.optional(z13.nullable(string4())),
2604
2680
  required_balance: optional2(number2()),
2605
2681
  balance: nullable(Balance$inboundSchema),
2606
- flag: nullable(z13.lazy(() => Flag$inboundSchema)),
2607
- preview: optional2(z13.lazy(() => Preview$inboundSchema))
2682
+ flag: nullable(z13.lazy(() => Flag2$inboundSchema)),
2683
+ preview: optional2(z13.lazy(() => Preview2$inboundSchema))
2608
2684
  }),
2609
2685
  z13.transform((v) => {
2610
2686
  return remap(v, {
@@ -2614,6 +2690,249 @@ var CheckResponse$inboundSchema = z13.pipe(
2614
2690
  });
2615
2691
  })
2616
2692
  );
2693
+ var FlagType1$inboundSchema = inboundSchema(FlagType1);
2694
+ var CheckCreditSchema1$inboundSchema = z13.pipe(
2695
+ z13.object({
2696
+ metered_feature_id: string4(),
2697
+ credit_cost: number2()
2698
+ }),
2699
+ z13.transform((v) => {
2700
+ return remap(v, {
2701
+ "metered_feature_id": "meteredFeatureId",
2702
+ "credit_cost": "creditCost"
2703
+ });
2704
+ })
2705
+ );
2706
+ var FlagDisplay1$inboundSchema = z13.object({
2707
+ singular: z13.optional(z13.nullable(string4())),
2708
+ plural: z13.optional(z13.nullable(string4()))
2709
+ });
2710
+ var CheckFeature1$inboundSchema = z13.pipe(
2711
+ z13.object({
2712
+ id: string4(),
2713
+ name: string4(),
2714
+ type: FlagType1$inboundSchema,
2715
+ consumable: boolean2(),
2716
+ event_names: optional2(z13.array(string4())),
2717
+ credit_schema: optional2(
2718
+ z13.array(z13.lazy(() => CheckCreditSchema1$inboundSchema))
2719
+ ),
2720
+ display: optional2(z13.lazy(() => FlagDisplay1$inboundSchema)),
2721
+ archived: boolean2()
2722
+ }),
2723
+ z13.transform((v) => {
2724
+ return remap(v, {
2725
+ "event_names": "eventNames",
2726
+ "credit_schema": "creditSchema"
2727
+ });
2728
+ })
2729
+ );
2730
+ var Flag1$inboundSchema = z13.pipe(
2731
+ z13.object({
2732
+ id: string4(),
2733
+ plan_id: nullable(string4()),
2734
+ expires_at: nullable(number2()),
2735
+ feature_id: string4(),
2736
+ feature: optional2(z13.lazy(() => CheckFeature1$inboundSchema))
2737
+ }),
2738
+ z13.transform((v) => {
2739
+ return remap(v, {
2740
+ "plan_id": "planId",
2741
+ "expires_at": "expiresAt",
2742
+ "feature_id": "featureId"
2743
+ });
2744
+ })
2745
+ );
2746
+ var Scenario1$inboundSchema = inboundSchema(Scenario1);
2747
+ var CheckEnv1$inboundSchema = inboundSchema(CheckEnv1);
2748
+ var ProductType1$inboundSchema = inboundSchema(ProductType1);
2749
+ var FeatureType1$inboundSchema = inboundSchema(FeatureType1);
2750
+ var IncludedUsage1$inboundSchema = smartUnion([number2(), string4()]);
2751
+ var CheckInterval1$inboundSchema = inboundSchema(CheckInterval1);
2752
+ var CheckTierBehavior1$inboundSchema = inboundSchema(CheckTierBehavior1);
2753
+ var UsageModel1$inboundSchema = inboundSchema(UsageModel1);
2754
+ var ProductDisplay1$inboundSchema = z13.pipe(
2755
+ z13.object({
2756
+ primary_text: string4(),
2757
+ secondary_text: z13.optional(z13.nullable(string4()))
2758
+ }),
2759
+ z13.transform((v) => {
2760
+ return remap(v, {
2761
+ "primary_text": "primaryText",
2762
+ "secondary_text": "secondaryText"
2763
+ });
2764
+ })
2765
+ );
2766
+ var ConfigDuration1$inboundSchema = inboundSchema(ConfigDuration1);
2767
+ var CheckRollover1$inboundSchema = z13.pipe(
2768
+ z13.object({
2769
+ max: z13.optional(z13.nullable(number2())),
2770
+ max_percentage: z13.optional(z13.nullable(number2())),
2771
+ duration: z13._default(ConfigDuration1$inboundSchema, "month"),
2772
+ length: number2()
2773
+ }),
2774
+ z13.transform((v) => {
2775
+ return remap(v, {
2776
+ "max_percentage": "maxPercentage"
2777
+ });
2778
+ })
2779
+ );
2780
+ var CheckOnIncrease1$inboundSchema = inboundSchema(CheckOnIncrease1);
2781
+ var CheckOnDecrease1$inboundSchema = inboundSchema(CheckOnDecrease1);
2782
+ var CheckConfig1$inboundSchema = z13.pipe(
2783
+ z13.object({
2784
+ rollover: z13.optional(
2785
+ z13.nullable(z13.lazy(() => CheckRollover1$inboundSchema))
2786
+ ),
2787
+ on_increase: z13.optional(z13.nullable(CheckOnIncrease1$inboundSchema)),
2788
+ on_decrease: z13.optional(z13.nullable(CheckOnDecrease1$inboundSchema))
2789
+ }),
2790
+ z13.transform((v) => {
2791
+ return remap(v, {
2792
+ "on_increase": "onIncrease",
2793
+ "on_decrease": "onDecrease"
2794
+ });
2795
+ })
2796
+ );
2797
+ var CheckItem1$inboundSchema = z13.pipe(
2798
+ z13.object({
2799
+ type: z13.optional(z13.nullable(ProductType1$inboundSchema)),
2800
+ feature_id: z13.optional(z13.nullable(string4())),
2801
+ feature_type: z13.optional(z13.nullable(FeatureType1$inboundSchema)),
2802
+ included_usage: z13.optional(
2803
+ z13.nullable(smartUnion([number2(), string4()]))
2804
+ ),
2805
+ interval: z13.optional(z13.nullable(CheckInterval1$inboundSchema)),
2806
+ interval_count: z13.optional(z13.nullable(number2())),
2807
+ price: z13.optional(z13.nullable(number2())),
2808
+ tiers: z13.optional(z13.nullable(z13.array(nullable(z13.any())))),
2809
+ tier_behavior: z13.optional(z13.nullable(CheckTierBehavior1$inboundSchema)),
2810
+ usage_model: z13.optional(z13.nullable(UsageModel1$inboundSchema)),
2811
+ billing_units: z13.optional(z13.nullable(number2())),
2812
+ reset_usage_when_enabled: z13.optional(z13.nullable(boolean2())),
2813
+ entity_feature_id: z13.optional(z13.nullable(string4())),
2814
+ display: z13.optional(
2815
+ z13.nullable(z13.lazy(() => ProductDisplay1$inboundSchema))
2816
+ ),
2817
+ quantity: z13.optional(z13.nullable(number2())),
2818
+ next_cycle_quantity: z13.optional(z13.nullable(number2())),
2819
+ config: z13.optional(z13.nullable(z13.lazy(() => CheckConfig1$inboundSchema)))
2820
+ }),
2821
+ z13.transform((v) => {
2822
+ return remap(v, {
2823
+ "feature_id": "featureId",
2824
+ "feature_type": "featureType",
2825
+ "included_usage": "includedUsage",
2826
+ "interval_count": "intervalCount",
2827
+ "tier_behavior": "tierBehavior",
2828
+ "usage_model": "usageModel",
2829
+ "billing_units": "billingUnits",
2830
+ "reset_usage_when_enabled": "resetUsageWhenEnabled",
2831
+ "entity_feature_id": "entityFeatureId",
2832
+ "next_cycle_quantity": "nextCycleQuantity"
2833
+ });
2834
+ })
2835
+ );
2836
+ var FreeTrialDuration1$inboundSchema = inboundSchema(FreeTrialDuration1);
2837
+ var CheckFreeTrial1$inboundSchema = z13.pipe(
2838
+ z13.object({
2839
+ duration: FreeTrialDuration1$inboundSchema,
2840
+ length: number2(),
2841
+ unique_fingerprint: boolean2(),
2842
+ card_required: boolean2(),
2843
+ trial_available: z13.nullable(z13._default(boolean2(), true))
2844
+ }),
2845
+ z13.transform((v) => {
2846
+ return remap(v, {
2847
+ "unique_fingerprint": "uniqueFingerprint",
2848
+ "card_required": "cardRequired",
2849
+ "trial_available": "trialAvailable"
2850
+ });
2851
+ })
2852
+ );
2853
+ var ProductScenario1$inboundSchema = inboundSchema(ProductScenario1);
2854
+ var Properties1$inboundSchema = z13.pipe(
2855
+ z13.object({
2856
+ is_free: boolean2(),
2857
+ is_one_off: boolean2(),
2858
+ interval_group: z13.optional(z13.nullable(string4())),
2859
+ has_trial: z13.optional(z13.nullable(boolean2())),
2860
+ updateable: z13.optional(z13.nullable(boolean2()))
2861
+ }),
2862
+ z13.transform((v) => {
2863
+ return remap(v, {
2864
+ "is_free": "isFree",
2865
+ "is_one_off": "isOneOff",
2866
+ "interval_group": "intervalGroup",
2867
+ "has_trial": "hasTrial"
2868
+ });
2869
+ })
2870
+ );
2871
+ var Product1$inboundSchema = z13.pipe(
2872
+ z13.object({
2873
+ id: string4(),
2874
+ name: string4(),
2875
+ group: nullable(string4()),
2876
+ env: CheckEnv1$inboundSchema,
2877
+ is_add_on: boolean2(),
2878
+ is_default: boolean2(),
2879
+ archived: boolean2(),
2880
+ version: number2(),
2881
+ created_at: number2(),
2882
+ items: z13.array(z13.lazy(() => CheckItem1$inboundSchema)),
2883
+ free_trial: nullable(z13.lazy(() => CheckFreeTrial1$inboundSchema)),
2884
+ base_variant_id: nullable(string4()),
2885
+ scenario: optional2(ProductScenario1$inboundSchema),
2886
+ properties: optional2(z13.lazy(() => Properties1$inboundSchema))
2887
+ }),
2888
+ z13.transform((v) => {
2889
+ return remap(v, {
2890
+ "is_add_on": "isAddOn",
2891
+ "is_default": "isDefault",
2892
+ "created_at": "createdAt",
2893
+ "free_trial": "freeTrial",
2894
+ "base_variant_id": "baseVariantId"
2895
+ });
2896
+ })
2897
+ );
2898
+ var Preview1$inboundSchema = z13.pipe(
2899
+ z13.object({
2900
+ scenario: Scenario1$inboundSchema,
2901
+ title: string4(),
2902
+ message: string4(),
2903
+ feature_id: string4(),
2904
+ feature_name: string4(),
2905
+ products: z13.array(z13.lazy(() => Product1$inboundSchema))
2906
+ }),
2907
+ z13.transform((v) => {
2908
+ return remap(v, {
2909
+ "feature_id": "featureId",
2910
+ "feature_name": "featureName"
2911
+ });
2912
+ })
2913
+ );
2914
+ var CheckResponseBody1$inboundSchema = z13.pipe(
2915
+ z13.object({
2916
+ allowed: boolean2(),
2917
+ customer_id: string4(),
2918
+ entity_id: z13.optional(z13.nullable(string4())),
2919
+ required_balance: optional2(number2()),
2920
+ balance: nullable(Balance$inboundSchema),
2921
+ flag: nullable(z13.lazy(() => Flag1$inboundSchema)),
2922
+ preview: optional2(z13.lazy(() => Preview1$inboundSchema))
2923
+ }),
2924
+ z13.transform((v) => {
2925
+ return remap(v, {
2926
+ "customer_id": "customerId",
2927
+ "entity_id": "entityId",
2928
+ "required_balance": "requiredBalance"
2929
+ });
2930
+ })
2931
+ );
2932
+ var CheckResponse$inboundSchema = smartUnion([
2933
+ z13.lazy(() => CheckResponseBody1$inboundSchema),
2934
+ z13.lazy(() => CheckResponseBody2$inboundSchema)
2935
+ ]);
2617
2936
 
2618
2937
  // ../sdk/src/models/create-balance-op.ts
2619
2938
  import * as z14 from "zod/v4-mini";
@@ -4588,9 +4907,16 @@ var FinalizeBalanceParams$outboundSchema = z27.pipe(
4588
4907
  });
4589
4908
  })
4590
4909
  );
4591
- var FinalizeLockResponse$inboundSchema = z27.object({
4910
+ var FinalizeLockResponseBody2$inboundSchema = z27.object({
4592
4911
  success: boolean2()
4593
4912
  });
4913
+ var FinalizeLockResponseBody1$inboundSchema = z27.object({
4914
+ success: boolean2()
4915
+ });
4916
+ var FinalizeLockResponse$inboundSchema = smartUnion([
4917
+ z27.lazy(() => FinalizeLockResponseBody1$inboundSchema),
4918
+ z27.lazy(() => FinalizeLockResponseBody2$inboundSchema)
4919
+ ]);
4594
4920
 
4595
4921
  // ../sdk/src/models/get-entity-op.ts
4596
4922
  import * as z28 from "zod/v4-mini";
@@ -8626,7 +8952,7 @@ var TrackParams$outboundSchema = z43.pipe(
8626
8952
  });
8627
8953
  })
8628
8954
  );
8629
- var TrackResponse$inboundSchema = z43.pipe(
8955
+ var TrackResponseBody2$inboundSchema = z43.pipe(
8630
8956
  z43.object({
8631
8957
  customer_id: string4(),
8632
8958
  entity_id: optional2(string4()),
@@ -8643,6 +8969,27 @@ var TrackResponse$inboundSchema = z43.pipe(
8643
8969
  });
8644
8970
  })
8645
8971
  );
8972
+ var TrackResponseBody1$inboundSchema = z43.pipe(
8973
+ z43.object({
8974
+ customer_id: string4(),
8975
+ entity_id: optional2(string4()),
8976
+ event_name: optional2(string4()),
8977
+ value: number2(),
8978
+ balance: nullable(Balance$inboundSchema),
8979
+ balances: optional2(z43.record(z43.string(), Balance$inboundSchema))
8980
+ }),
8981
+ z43.transform((v) => {
8982
+ return remap(v, {
8983
+ "customer_id": "customerId",
8984
+ "entity_id": "entityId",
8985
+ "event_name": "eventName"
8986
+ });
8987
+ })
8988
+ );
8989
+ var TrackResponse$inboundSchema = smartUnion([
8990
+ z43.lazy(() => TrackResponseBody1$inboundSchema),
8991
+ z43.lazy(() => TrackResponseBody2$inboundSchema)
8992
+ ]);
8646
8993
 
8647
8994
  // ../sdk/src/models/update-balance-op.ts
8648
8995
  import * as z44 from "zod/v4-mini";
@@ -10127,6 +10474,7 @@ async function $do(client, request, options) {
10127
10474
  const response = doResult.value;
10128
10475
  const [result] = await match(
10129
10476
  json(200, CheckResponse$inboundSchema),
10477
+ json(202, CheckResponse$inboundSchema),
10130
10478
  fail("4XX"),
10131
10479
  fail("5XX")
10132
10480
  )(response, req);
@@ -10205,6 +10553,7 @@ async function $do2(client, request, options) {
10205
10553
  const response = doResult.value;
10206
10554
  const [result] = await match(
10207
10555
  json(200, TrackResponse$inboundSchema),
10556
+ json(202, TrackResponse$inboundSchema),
10208
10557
  fail("4XX"),
10209
10558
  fail("5XX")
10210
10559
  )(response, req);
@@ -11044,6 +11393,7 @@ async function $do5(client, request, options) {
11044
11393
  const response = doResult.value;
11045
11394
  const [result] = await match(
11046
11395
  json(200, FinalizeLockResponse$inboundSchema),
11396
+ json(202, FinalizeLockResponse$inboundSchema),
11047
11397
  fail("4XX"),
11048
11398
  fail("5XX")
11049
11399
  )(response, req);
@@ -14442,7 +14792,7 @@ var Autumn = class extends ClientSDK {
14442
14792
  * @param lock - Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold. (optional)
14443
14793
  * @param withPreview - If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls. (optional)
14444
14794
  *
14445
- * @returns Whether access is allowed, plus the current balance for that feature.
14795
+ * @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.
14446
14796
  */
14447
14797
  async check(request, options) {
14448
14798
  return unwrapAsync(check(
@@ -14475,7 +14825,7 @@ var Autumn = class extends ClientSDK {
14475
14825
  * @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
14476
14826
  * @param properties - Additional properties to attach to this usage event. (optional)
14477
14827
  *
14478
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances.
14828
+ * @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.
14479
14829
  */
14480
14830
  async track(request, options) {
14481
14831
  return unwrapAsync(track(