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
@@ -1261,7 +1261,7 @@ type CheckParams = {
1261
1261
  /**
1262
1262
  * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
1263
1263
  */
1264
- declare const FlagType: {
1264
+ declare const FlagType2: {
1265
1265
  readonly Boolean: "boolean";
1266
1266
  readonly Metered: "metered";
1267
1267
  readonly CreditSystem: "credit_system";
@@ -1269,8 +1269,8 @@ declare const FlagType: {
1269
1269
  /**
1270
1270
  * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
1271
1271
  */
1272
- type FlagType = OpenEnum<typeof FlagType>;
1273
- type CheckCreditSchema = {
1272
+ type FlagType2 = OpenEnum<typeof FlagType2>;
1273
+ type CheckCreditSchema2 = {
1274
1274
  /**
1275
1275
  * ID of the metered feature that draws from this credit system.
1276
1276
  */
@@ -1283,7 +1283,7 @@ type CheckCreditSchema = {
1283
1283
  /**
1284
1284
  * Display names for the feature in billing UI and customer-facing components.
1285
1285
  */
1286
- type FlagDisplay = {
1286
+ type FlagDisplay2 = {
1287
1287
  /**
1288
1288
  * Singular form for UI display (e.g., 'API call', 'seat').
1289
1289
  */
@@ -1296,7 +1296,7 @@ type FlagDisplay = {
1296
1296
  /**
1297
1297
  * The full feature object if expanded.
1298
1298
  */
1299
- type CheckFeature = {
1299
+ type CheckFeature2 = {
1300
1300
  /**
1301
1301
  * The unique identifier for this feature, used in /check and /track calls.
1302
1302
  */
@@ -1308,7 +1308,7 @@ type CheckFeature = {
1308
1308
  /**
1309
1309
  * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
1310
1310
  */
1311
- type: FlagType;
1311
+ type: FlagType2;
1312
1312
  /**
1313
1313
  * For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
1314
1314
  */
@@ -1320,17 +1320,17 @@ type CheckFeature = {
1320
1320
  /**
1321
1321
  * For credit_system features: maps metered features to their credit costs.
1322
1322
  */
1323
- creditSchema?: Array<CheckCreditSchema> | undefined;
1323
+ creditSchema?: Array<CheckCreditSchema2> | undefined;
1324
1324
  /**
1325
1325
  * Display names for the feature in billing UI and customer-facing components.
1326
1326
  */
1327
- display?: FlagDisplay | undefined;
1327
+ display?: FlagDisplay2 | undefined;
1328
1328
  /**
1329
1329
  * Whether the feature is archived and hidden from the dashboard.
1330
1330
  */
1331
1331
  archived: boolean;
1332
1332
  };
1333
- type Flag = {
1333
+ type Flag2 = {
1334
1334
  /**
1335
1335
  * The unique identifier for this flag.
1336
1336
  */
@@ -1350,44 +1350,44 @@ type Flag = {
1350
1350
  /**
1351
1351
  * The full feature object if expanded.
1352
1352
  */
1353
- feature?: CheckFeature | undefined;
1353
+ feature?: CheckFeature2 | undefined;
1354
1354
  };
1355
1355
  /**
1356
1356
  * The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
1357
1357
  */
1358
- declare const Scenario: {
1358
+ declare const Scenario2: {
1359
1359
  readonly UsageLimit: "usage_limit";
1360
1360
  readonly FeatureFlag: "feature_flag";
1361
1361
  };
1362
1362
  /**
1363
1363
  * The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
1364
1364
  */
1365
- type Scenario = OpenEnum<typeof Scenario>;
1365
+ type Scenario2 = OpenEnum<typeof Scenario2>;
1366
1366
  /**
1367
1367
  * The environment of the product
1368
1368
  */
1369
- declare const CheckEnv: {
1369
+ declare const CheckEnv2: {
1370
1370
  readonly Sandbox: "sandbox";
1371
1371
  readonly Live: "live";
1372
1372
  };
1373
1373
  /**
1374
1374
  * The environment of the product
1375
1375
  */
1376
- type CheckEnv = OpenEnum<typeof CheckEnv>;
1377
- declare const ProductType: {
1376
+ type CheckEnv2 = OpenEnum<typeof CheckEnv2>;
1377
+ declare const ProductType2: {
1378
1378
  readonly Feature: "feature";
1379
1379
  readonly PricedFeature: "priced_feature";
1380
1380
  readonly Price: "price";
1381
1381
  };
1382
- type ProductType = OpenEnum<typeof ProductType>;
1383
- declare const FeatureType: {
1382
+ type ProductType2 = OpenEnum<typeof ProductType2>;
1383
+ declare const FeatureType2: {
1384
1384
  readonly SingleUse: "single_use";
1385
1385
  readonly ContinuousUse: "continuous_use";
1386
1386
  readonly Boolean: "boolean";
1387
1387
  readonly Static: "static";
1388
1388
  };
1389
- type FeatureType = OpenEnum<typeof FeatureType>;
1390
- declare const CheckInterval: {
1389
+ type FeatureType2 = OpenEnum<typeof FeatureType2>;
1390
+ declare const CheckInterval2: {
1391
1391
  readonly Minute: "minute";
1392
1392
  readonly Hour: "hour";
1393
1393
  readonly Day: "day";
@@ -1397,60 +1397,60 @@ declare const CheckInterval: {
1397
1397
  readonly SemiAnnual: "semi_annual";
1398
1398
  readonly Year: "year";
1399
1399
  };
1400
- type CheckInterval = OpenEnum<typeof CheckInterval>;
1401
- declare const CheckTierBehavior: {
1400
+ type CheckInterval2 = OpenEnum<typeof CheckInterval2>;
1401
+ declare const CheckTierBehavior2: {
1402
1402
  readonly Graduated: "graduated";
1403
1403
  readonly Volume: "volume";
1404
1404
  };
1405
- type CheckTierBehavior = OpenEnum<typeof CheckTierBehavior>;
1406
- declare const UsageModel: {
1405
+ type CheckTierBehavior2 = OpenEnum<typeof CheckTierBehavior2>;
1406
+ declare const UsageModel2: {
1407
1407
  readonly Prepaid: "prepaid";
1408
1408
  readonly PayPerUse: "pay_per_use";
1409
1409
  };
1410
- type UsageModel = OpenEnum<typeof UsageModel>;
1411
- type ProductDisplay = {
1410
+ type UsageModel2 = OpenEnum<typeof UsageModel2>;
1411
+ type ProductDisplay2 = {
1412
1412
  primaryText: string;
1413
1413
  secondaryText?: string | null | undefined;
1414
1414
  };
1415
- declare const ConfigDuration: {
1415
+ declare const ConfigDuration2: {
1416
1416
  readonly Month: "month";
1417
1417
  readonly Forever: "forever";
1418
1418
  };
1419
- type ConfigDuration = OpenEnum<typeof ConfigDuration>;
1420
- type CheckRollover = {
1419
+ type ConfigDuration2 = OpenEnum<typeof ConfigDuration2>;
1420
+ type CheckRollover2 = {
1421
1421
  max?: number | null | undefined;
1422
1422
  maxPercentage?: number | null | undefined;
1423
- duration: ConfigDuration;
1423
+ duration: ConfigDuration2;
1424
1424
  length: number;
1425
1425
  };
1426
- declare const CheckOnIncrease: {
1426
+ declare const CheckOnIncrease2: {
1427
1427
  readonly BillImmediately: "bill_immediately";
1428
1428
  readonly ProrateImmediately: "prorate_immediately";
1429
1429
  readonly ProrateNextCycle: "prorate_next_cycle";
1430
1430
  readonly BillNextCycle: "bill_next_cycle";
1431
1431
  };
1432
- type CheckOnIncrease = OpenEnum<typeof CheckOnIncrease>;
1433
- declare const CheckOnDecrease: {
1432
+ type CheckOnIncrease2 = OpenEnum<typeof CheckOnIncrease2>;
1433
+ declare const CheckOnDecrease2: {
1434
1434
  readonly Prorate: "prorate";
1435
1435
  readonly ProrateImmediately: "prorate_immediately";
1436
1436
  readonly ProrateNextCycle: "prorate_next_cycle";
1437
1437
  readonly None: "none";
1438
1438
  readonly NoProrations: "no_prorations";
1439
1439
  };
1440
- type CheckOnDecrease = OpenEnum<typeof CheckOnDecrease>;
1441
- type CheckConfig = {
1442
- rollover?: CheckRollover | null | undefined;
1443
- onIncrease?: CheckOnIncrease | null | undefined;
1444
- onDecrease?: CheckOnDecrease | null | undefined;
1440
+ type CheckOnDecrease2 = OpenEnum<typeof CheckOnDecrease2>;
1441
+ type CheckConfig2 = {
1442
+ rollover?: CheckRollover2 | null | undefined;
1443
+ onIncrease?: CheckOnIncrease2 | null | undefined;
1444
+ onDecrease?: CheckOnDecrease2 | null | undefined;
1445
1445
  };
1446
1446
  /**
1447
1447
  * Product item defining features and pricing within a product
1448
1448
  */
1449
- type CheckItem = {
1449
+ type CheckItem2 = {
1450
1450
  /**
1451
1451
  * The type of the product item
1452
1452
  */
1453
- type?: ProductType | null | undefined;
1453
+ type?: ProductType2 | null | undefined;
1454
1454
  /**
1455
1455
  * The feature ID of the product item. If the item is a fixed price, should be `null`
1456
1456
  */
@@ -1458,7 +1458,7 @@ type CheckItem = {
1458
1458
  /**
1459
1459
  * Single use features are used once and then depleted, like API calls or credits. Continuous use features are those being used on an ongoing-basis, like storage or seats.
1460
1460
  */
1461
- featureType?: FeatureType | null | undefined;
1461
+ featureType?: FeatureType2 | null | undefined;
1462
1462
  /**
1463
1463
  * The amount of usage included for this feature.
1464
1464
  */
@@ -1466,7 +1466,7 @@ type CheckItem = {
1466
1466
  /**
1467
1467
  * The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off.
1468
1468
  */
1469
- interval?: CheckInterval | null | undefined;
1469
+ interval?: CheckInterval2 | null | undefined;
1470
1470
  /**
1471
1471
  * The interval count of the product item.
1472
1472
  */
@@ -1482,11 +1482,11 @@ type CheckItem = {
1482
1482
  /**
1483
1483
  * How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier). Defaults to graduated.
1484
1484
  */
1485
- tierBehavior?: CheckTierBehavior | null | undefined;
1485
+ tierBehavior?: CheckTierBehavior2 | null | undefined;
1486
1486
  /**
1487
1487
  * Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
1488
1488
  */
1489
- usageModel?: UsageModel | null | undefined;
1489
+ usageModel?: UsageModel2 | null | undefined;
1490
1490
  /**
1491
1491
  * The amount per billing unit (eg. $9 / 250 units)
1492
1492
  */
@@ -1502,7 +1502,7 @@ type CheckItem = {
1502
1502
  /**
1503
1503
  * The display of the product item.
1504
1504
  */
1505
- display?: ProductDisplay | null | undefined;
1505
+ display?: ProductDisplay2 | null | undefined;
1506
1506
  /**
1507
1507
  * Used in customer context. Quantity of the feature the customer has prepaid for.
1508
1508
  */
@@ -1514,12 +1514,12 @@ type CheckItem = {
1514
1514
  /**
1515
1515
  * Configuration for rollover and proration behavior of the feature.
1516
1516
  */
1517
- config?: CheckConfig | null | undefined;
1517
+ config?: CheckConfig2 | null | undefined;
1518
1518
  };
1519
1519
  /**
1520
1520
  * The duration type of the free trial
1521
1521
  */
1522
- declare const FreeTrialDuration: {
1522
+ declare const FreeTrialDuration2: {
1523
1523
  readonly Day: "day";
1524
1524
  readonly Month: "month";
1525
1525
  readonly Year: "year";
@@ -1527,12 +1527,12 @@ declare const FreeTrialDuration: {
1527
1527
  /**
1528
1528
  * The duration type of the free trial
1529
1529
  */
1530
- type FreeTrialDuration = OpenEnum<typeof FreeTrialDuration>;
1531
- type CheckFreeTrial = {
1530
+ type FreeTrialDuration2 = OpenEnum<typeof FreeTrialDuration2>;
1531
+ type CheckFreeTrial2 = {
1532
1532
  /**
1533
1533
  * The duration type of the free trial
1534
1534
  */
1535
- duration: FreeTrialDuration;
1535
+ duration: FreeTrialDuration2;
1536
1536
  /**
1537
1537
  * The length of the duration type specified
1538
1538
  */
@@ -1553,7 +1553,7 @@ type CheckFreeTrial = {
1553
1553
  /**
1554
1554
  * Scenario for when this product is used in attach flows
1555
1555
  */
1556
- declare const ProductScenario: {
1556
+ declare const ProductScenario2: {
1557
1557
  readonly Scheduled: "scheduled";
1558
1558
  readonly Active: "active";
1559
1559
  readonly New: "new";
@@ -1568,8 +1568,8 @@ declare const ProductScenario: {
1568
1568
  /**
1569
1569
  * Scenario for when this product is used in attach flows
1570
1570
  */
1571
- type ProductScenario = OpenEnum<typeof ProductScenario>;
1572
- type Properties = {
1571
+ type ProductScenario2 = OpenEnum<typeof ProductScenario2>;
1572
+ type Properties2 = {
1573
1573
  /**
1574
1574
  * True if the product has no base price or usage prices
1575
1575
  */
@@ -1591,7 +1591,7 @@ type Properties = {
1591
1591
  */
1592
1592
  updateable?: boolean | null | undefined;
1593
1593
  };
1594
- type Product = {
1594
+ type Product2 = {
1595
1595
  /**
1596
1596
  * The ID of the product you set when creating the product
1597
1597
  */
@@ -1607,7 +1607,7 @@ type Product = {
1607
1607
  /**
1608
1608
  * The environment of the product
1609
1609
  */
1610
- env: CheckEnv;
1610
+ env: CheckEnv2;
1611
1611
  /**
1612
1612
  * Whether the product is an add-on and can be purchased alongside other products
1613
1613
  */
@@ -1631,11 +1631,11 @@ type Product = {
1631
1631
  /**
1632
1632
  * Array of product items that define the product's features and pricing
1633
1633
  */
1634
- items: Array<CheckItem>;
1634
+ items: Array<CheckItem2>;
1635
1635
  /**
1636
1636
  * Free trial configuration for this product, if available
1637
1637
  */
1638
- freeTrial: CheckFreeTrial | null;
1638
+ freeTrial: CheckFreeTrial2 | null;
1639
1639
  /**
1640
1640
  * ID of the base variant this product is derived from
1641
1641
  */
@@ -1643,17 +1643,17 @@ type Product = {
1643
1643
  /**
1644
1644
  * Scenario for when this product is used in attach flows
1645
1645
  */
1646
- scenario?: ProductScenario | undefined;
1647
- properties?: Properties | undefined;
1646
+ scenario?: ProductScenario2 | undefined;
1647
+ properties?: Properties2 | undefined;
1648
1648
  };
1649
1649
  /**
1650
1650
  * Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
1651
1651
  */
1652
- type Preview = {
1652
+ type Preview2 = {
1653
1653
  /**
1654
1654
  * The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
1655
1655
  */
1656
- scenario: Scenario;
1656
+ scenario: Scenario2;
1657
1657
  /**
1658
1658
  * A title suitable for displaying in a paywall or upgrade modal.
1659
1659
  */
@@ -1673,12 +1673,462 @@ type Preview = {
1673
1673
  /**
1674
1674
  * Products that would grant access to this feature. Use to display upgrade options.
1675
1675
  */
1676
- products: Array<Product>;
1676
+ products: Array<Product2>;
1677
+ };
1678
+ /**
1679
+ * Accepted. Autumn is experiencing degraded service from a downstream provider, so access was allowed fail-open.
1680
+ */
1681
+ type CheckResponseBody2 = {
1682
+ /**
1683
+ * Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
1684
+ */
1685
+ allowed: boolean;
1686
+ /**
1687
+ * The ID of the customer that was checked.
1688
+ */
1689
+ customerId: string;
1690
+ /**
1691
+ * The ID of the entity, if an entity-scoped check was performed.
1692
+ */
1693
+ entityId?: string | null | undefined;
1694
+ /**
1695
+ * The required balance that was checked against.
1696
+ */
1697
+ requiredBalance?: number | undefined;
1698
+ /**
1699
+ * The customer's balance for this feature. Null if the customer has no balance for this feature.
1700
+ */
1701
+ balance: Balance | null;
1702
+ /**
1703
+ * The flag associated with this check, if any.
1704
+ */
1705
+ flag: Flag2 | null;
1706
+ /**
1707
+ * Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
1708
+ */
1709
+ preview?: Preview2 | undefined;
1710
+ };
1711
+ /**
1712
+ * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
1713
+ */
1714
+ declare const FlagType1: {
1715
+ readonly Boolean: "boolean";
1716
+ readonly Metered: "metered";
1717
+ readonly CreditSystem: "credit_system";
1718
+ };
1719
+ /**
1720
+ * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
1721
+ */
1722
+ type FlagType1 = OpenEnum<typeof FlagType1>;
1723
+ type CheckCreditSchema1 = {
1724
+ /**
1725
+ * ID of the metered feature that draws from this credit system.
1726
+ */
1727
+ meteredFeatureId: string;
1728
+ /**
1729
+ * Credits consumed per unit of the metered feature.
1730
+ */
1731
+ creditCost: number;
1732
+ };
1733
+ /**
1734
+ * Display names for the feature in billing UI and customer-facing components.
1735
+ */
1736
+ type FlagDisplay1 = {
1737
+ /**
1738
+ * Singular form for UI display (e.g., 'API call', 'seat').
1739
+ */
1740
+ singular?: string | null | undefined;
1741
+ /**
1742
+ * Plural form for UI display (e.g., 'API calls', 'seats').
1743
+ */
1744
+ plural?: string | null | undefined;
1745
+ };
1746
+ /**
1747
+ * The full feature object if expanded.
1748
+ */
1749
+ type CheckFeature1 = {
1750
+ /**
1751
+ * The unique identifier for this feature, used in /check and /track calls.
1752
+ */
1753
+ id: string;
1754
+ /**
1755
+ * Human-readable name displayed in the dashboard and billing UI.
1756
+ */
1757
+ name: string;
1758
+ /**
1759
+ * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
1760
+ */
1761
+ type: FlagType1;
1762
+ /**
1763
+ * For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
1764
+ */
1765
+ consumable: boolean;
1766
+ /**
1767
+ * Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
1768
+ */
1769
+ eventNames?: Array<string> | undefined;
1770
+ /**
1771
+ * For credit_system features: maps metered features to their credit costs.
1772
+ */
1773
+ creditSchema?: Array<CheckCreditSchema1> | undefined;
1774
+ /**
1775
+ * Display names for the feature in billing UI and customer-facing components.
1776
+ */
1777
+ display?: FlagDisplay1 | undefined;
1778
+ /**
1779
+ * Whether the feature is archived and hidden from the dashboard.
1780
+ */
1781
+ archived: boolean;
1782
+ };
1783
+ type Flag1 = {
1784
+ /**
1785
+ * The unique identifier for this flag.
1786
+ */
1787
+ id: string;
1788
+ /**
1789
+ * The plan ID this flag originates from, or null for standalone flags.
1790
+ */
1791
+ planId: string | null;
1792
+ /**
1793
+ * Timestamp when this flag expires, or null for no expiration.
1794
+ */
1795
+ expiresAt: number | null;
1796
+ /**
1797
+ * The feature ID this flag is for.
1798
+ */
1799
+ featureId: string;
1800
+ /**
1801
+ * The full feature object if expanded.
1802
+ */
1803
+ feature?: CheckFeature1 | undefined;
1804
+ };
1805
+ /**
1806
+ * The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
1807
+ */
1808
+ declare const Scenario1: {
1809
+ readonly UsageLimit: "usage_limit";
1810
+ readonly FeatureFlag: "feature_flag";
1811
+ };
1812
+ /**
1813
+ * The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
1814
+ */
1815
+ type Scenario1 = OpenEnum<typeof Scenario1>;
1816
+ /**
1817
+ * The environment of the product
1818
+ */
1819
+ declare const CheckEnv1: {
1820
+ readonly Sandbox: "sandbox";
1821
+ readonly Live: "live";
1822
+ };
1823
+ /**
1824
+ * The environment of the product
1825
+ */
1826
+ type CheckEnv1 = OpenEnum<typeof CheckEnv1>;
1827
+ declare const ProductType1: {
1828
+ readonly Feature: "feature";
1829
+ readonly PricedFeature: "priced_feature";
1830
+ readonly Price: "price";
1831
+ };
1832
+ type ProductType1 = OpenEnum<typeof ProductType1>;
1833
+ declare const FeatureType1: {
1834
+ readonly SingleUse: "single_use";
1835
+ readonly ContinuousUse: "continuous_use";
1836
+ readonly Boolean: "boolean";
1837
+ readonly Static: "static";
1838
+ };
1839
+ type FeatureType1 = OpenEnum<typeof FeatureType1>;
1840
+ declare const CheckInterval1: {
1841
+ readonly Minute: "minute";
1842
+ readonly Hour: "hour";
1843
+ readonly Day: "day";
1844
+ readonly Week: "week";
1845
+ readonly Month: "month";
1846
+ readonly Quarter: "quarter";
1847
+ readonly SemiAnnual: "semi_annual";
1848
+ readonly Year: "year";
1849
+ };
1850
+ type CheckInterval1 = OpenEnum<typeof CheckInterval1>;
1851
+ declare const CheckTierBehavior1: {
1852
+ readonly Graduated: "graduated";
1853
+ readonly Volume: "volume";
1854
+ };
1855
+ type CheckTierBehavior1 = OpenEnum<typeof CheckTierBehavior1>;
1856
+ declare const UsageModel1: {
1857
+ readonly Prepaid: "prepaid";
1858
+ readonly PayPerUse: "pay_per_use";
1859
+ };
1860
+ type UsageModel1 = OpenEnum<typeof UsageModel1>;
1861
+ type ProductDisplay1 = {
1862
+ primaryText: string;
1863
+ secondaryText?: string | null | undefined;
1864
+ };
1865
+ declare const ConfigDuration1: {
1866
+ readonly Month: "month";
1867
+ readonly Forever: "forever";
1868
+ };
1869
+ type ConfigDuration1 = OpenEnum<typeof ConfigDuration1>;
1870
+ type CheckRollover1 = {
1871
+ max?: number | null | undefined;
1872
+ maxPercentage?: number | null | undefined;
1873
+ duration: ConfigDuration1;
1874
+ length: number;
1875
+ };
1876
+ declare const CheckOnIncrease1: {
1877
+ readonly BillImmediately: "bill_immediately";
1878
+ readonly ProrateImmediately: "prorate_immediately";
1879
+ readonly ProrateNextCycle: "prorate_next_cycle";
1880
+ readonly BillNextCycle: "bill_next_cycle";
1881
+ };
1882
+ type CheckOnIncrease1 = OpenEnum<typeof CheckOnIncrease1>;
1883
+ declare const CheckOnDecrease1: {
1884
+ readonly Prorate: "prorate";
1885
+ readonly ProrateImmediately: "prorate_immediately";
1886
+ readonly ProrateNextCycle: "prorate_next_cycle";
1887
+ readonly None: "none";
1888
+ readonly NoProrations: "no_prorations";
1889
+ };
1890
+ type CheckOnDecrease1 = OpenEnum<typeof CheckOnDecrease1>;
1891
+ type CheckConfig1 = {
1892
+ rollover?: CheckRollover1 | null | undefined;
1893
+ onIncrease?: CheckOnIncrease1 | null | undefined;
1894
+ onDecrease?: CheckOnDecrease1 | null | undefined;
1895
+ };
1896
+ /**
1897
+ * Product item defining features and pricing within a product
1898
+ */
1899
+ type CheckItem1 = {
1900
+ /**
1901
+ * The type of the product item
1902
+ */
1903
+ type?: ProductType1 | null | undefined;
1904
+ /**
1905
+ * The feature ID of the product item. If the item is a fixed price, should be `null`
1906
+ */
1907
+ featureId?: string | null | undefined;
1908
+ /**
1909
+ * Single use features are used once and then depleted, like API calls or credits. Continuous use features are those being used on an ongoing-basis, like storage or seats.
1910
+ */
1911
+ featureType?: FeatureType1 | null | undefined;
1912
+ /**
1913
+ * The amount of usage included for this feature.
1914
+ */
1915
+ includedUsage?: number | string | null | undefined;
1916
+ /**
1917
+ * The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off.
1918
+ */
1919
+ interval?: CheckInterval1 | null | undefined;
1920
+ /**
1921
+ * The interval count of the product item.
1922
+ */
1923
+ intervalCount?: number | null | undefined;
1924
+ /**
1925
+ * The price of the product item. Should be `null` if tiered pricing is set.
1926
+ */
1927
+ price?: number | null | undefined;
1928
+ /**
1929
+ * Tiered pricing for the product item. Not applicable for fixed price items.
1930
+ */
1931
+ tiers?: Array<any | null> | null | undefined;
1932
+ /**
1933
+ * How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier). Defaults to graduated.
1934
+ */
1935
+ tierBehavior?: CheckTierBehavior1 | null | undefined;
1936
+ /**
1937
+ * Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
1938
+ */
1939
+ usageModel?: UsageModel1 | null | undefined;
1940
+ /**
1941
+ * The amount per billing unit (eg. $9 / 250 units)
1942
+ */
1943
+ billingUnits?: number | null | undefined;
1944
+ /**
1945
+ * Whether the usage should be reset when the product is enabled.
1946
+ */
1947
+ resetUsageWhenEnabled?: boolean | null | undefined;
1948
+ /**
1949
+ * The entity feature ID of the product item if applicable.
1950
+ */
1951
+ entityFeatureId?: string | null | undefined;
1952
+ /**
1953
+ * The display of the product item.
1954
+ */
1955
+ display?: ProductDisplay1 | null | undefined;
1956
+ /**
1957
+ * Used in customer context. Quantity of the feature the customer has prepaid for.
1958
+ */
1959
+ quantity?: number | null | undefined;
1960
+ /**
1961
+ * Used in customer context. Quantity of the feature the customer will prepay for in the next cycle.
1962
+ */
1963
+ nextCycleQuantity?: number | null | undefined;
1964
+ /**
1965
+ * Configuration for rollover and proration behavior of the feature.
1966
+ */
1967
+ config?: CheckConfig1 | null | undefined;
1968
+ };
1969
+ /**
1970
+ * The duration type of the free trial
1971
+ */
1972
+ declare const FreeTrialDuration1: {
1973
+ readonly Day: "day";
1974
+ readonly Month: "month";
1975
+ readonly Year: "year";
1976
+ };
1977
+ /**
1978
+ * The duration type of the free trial
1979
+ */
1980
+ type FreeTrialDuration1 = OpenEnum<typeof FreeTrialDuration1>;
1981
+ type CheckFreeTrial1 = {
1982
+ /**
1983
+ * The duration type of the free trial
1984
+ */
1985
+ duration: FreeTrialDuration1;
1986
+ /**
1987
+ * The length of the duration type specified
1988
+ */
1989
+ length: number;
1990
+ /**
1991
+ * Whether the free trial is limited to one per customer fingerprint
1992
+ */
1993
+ uniqueFingerprint: boolean;
1994
+ /**
1995
+ * Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file.
1996
+ */
1997
+ cardRequired: boolean;
1998
+ /**
1999
+ * Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
2000
+ */
2001
+ trialAvailable: boolean | null;
2002
+ };
2003
+ /**
2004
+ * Scenario for when this product is used in attach flows
2005
+ */
2006
+ declare const ProductScenario1: {
2007
+ readonly Scheduled: "scheduled";
2008
+ readonly Active: "active";
2009
+ readonly New: "new";
2010
+ readonly Renew: "renew";
2011
+ readonly Upgrade: "upgrade";
2012
+ readonly UpdatePrepaidQuantity: "update_prepaid_quantity";
2013
+ readonly Downgrade: "downgrade";
2014
+ readonly Cancel: "cancel";
2015
+ readonly Expired: "expired";
2016
+ readonly PastDue: "past_due";
2017
+ };
2018
+ /**
2019
+ * Scenario for when this product is used in attach flows
2020
+ */
2021
+ type ProductScenario1 = OpenEnum<typeof ProductScenario1>;
2022
+ type Properties1 = {
2023
+ /**
2024
+ * True if the product has no base price or usage prices
2025
+ */
2026
+ isFree: boolean;
2027
+ /**
2028
+ * True if the product only contains a one-time price
2029
+ */
2030
+ isOneOff: boolean;
2031
+ /**
2032
+ * The billing interval group for recurring products (e.g., 'monthly', 'yearly')
2033
+ */
2034
+ intervalGroup?: string | null | undefined;
2035
+ /**
2036
+ * True if the product includes a free trial
2037
+ */
2038
+ hasTrial?: boolean | null | undefined;
2039
+ /**
2040
+ * True if the product can be updated after creation (only applicable if there are prepaid recurring prices)
2041
+ */
2042
+ updateable?: boolean | null | undefined;
2043
+ };
2044
+ type Product1 = {
2045
+ /**
2046
+ * The ID of the product you set when creating the product
2047
+ */
2048
+ id: string;
2049
+ /**
2050
+ * The name of the product
2051
+ */
2052
+ name: string;
2053
+ /**
2054
+ * Product group which this product belongs to
2055
+ */
2056
+ group: string | null;
2057
+ /**
2058
+ * The environment of the product
2059
+ */
2060
+ env: CheckEnv1;
2061
+ /**
2062
+ * Whether the product is an add-on and can be purchased alongside other products
2063
+ */
2064
+ isAddOn: boolean;
2065
+ /**
2066
+ * Whether the product is the default product
2067
+ */
2068
+ isDefault: boolean;
2069
+ /**
2070
+ * Whether this product has been archived and is no longer available
2071
+ */
2072
+ archived: boolean;
2073
+ /**
2074
+ * The current version of the product
2075
+ */
2076
+ version: number;
2077
+ /**
2078
+ * The timestamp of when the product was created in milliseconds since epoch
2079
+ */
2080
+ createdAt: number;
2081
+ /**
2082
+ * Array of product items that define the product's features and pricing
2083
+ */
2084
+ items: Array<CheckItem1>;
2085
+ /**
2086
+ * Free trial configuration for this product, if available
2087
+ */
2088
+ freeTrial: CheckFreeTrial1 | null;
2089
+ /**
2090
+ * ID of the base variant this product is derived from
2091
+ */
2092
+ baseVariantId: string | null;
2093
+ /**
2094
+ * Scenario for when this product is used in attach flows
2095
+ */
2096
+ scenario?: ProductScenario1 | undefined;
2097
+ properties?: Properties1 | undefined;
2098
+ };
2099
+ /**
2100
+ * Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
2101
+ */
2102
+ type Preview1 = {
2103
+ /**
2104
+ * The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
2105
+ */
2106
+ scenario: Scenario1;
2107
+ /**
2108
+ * A title suitable for displaying in a paywall or upgrade modal.
2109
+ */
2110
+ title: string;
2111
+ /**
2112
+ * A message explaining why access was denied.
2113
+ */
2114
+ message: string;
2115
+ /**
2116
+ * The ID of the feature that was checked.
2117
+ */
2118
+ featureId: string;
2119
+ /**
2120
+ * The display name of the feature.
2121
+ */
2122
+ featureName: string;
2123
+ /**
2124
+ * Products that would grant access to this feature. Use to display upgrade options.
2125
+ */
2126
+ products: Array<Product1>;
1677
2127
  };
1678
2128
  /**
1679
2129
  * OK
1680
2130
  */
1681
- type CheckResponse = {
2131
+ type CheckResponseBody1 = {
1682
2132
  /**
1683
2133
  * Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
1684
2134
  */
@@ -1702,12 +2152,13 @@ type CheckResponse = {
1702
2152
  /**
1703
2153
  * The flag associated with this check, if any.
1704
2154
  */
1705
- flag: Flag | null;
2155
+ flag: Flag1 | null;
1706
2156
  /**
1707
2157
  * Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
1708
2158
  */
1709
- preview?: Preview | undefined;
2159
+ preview?: Preview1 | undefined;
1710
2160
  };
2161
+ type CheckResponse = CheckResponseBody1 | CheckResponseBody2;
1711
2162
 
1712
2163
  /**
1713
2164
  * The time interval for the purchase limit window.