autumn-js 1.3.2 → 1.3.3

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 (121) hide show
  1. package/dist/backend/adapters/express.js +6018 -6627
  2. package/dist/backend/adapters/express.mjs +9 -9
  3. package/dist/backend/adapters/fetch.js +6018 -6627
  4. package/dist/backend/adapters/fetch.mjs +9 -9
  5. package/dist/backend/adapters/hono.js +6018 -6627
  6. package/dist/backend/adapters/hono.mjs +9 -9
  7. package/dist/backend/adapters/index.js +6019 -6628
  8. package/dist/backend/adapters/index.mjs +12 -12
  9. package/dist/backend/adapters/next.js +6018 -6627
  10. package/dist/backend/adapters/next.mjs +9 -9
  11. package/dist/backend/{chunk-P3NB2TPD.mjs → chunk-65W4TZTS.mjs} +1 -1
  12. package/dist/backend/{chunk-U3XVAFP3.mjs → chunk-7KCCF4EQ.mjs} +1 -1
  13. package/dist/backend/{chunk-BN2RKNWA.mjs → chunk-7M2QJK3F.mjs} +1 -1
  14. package/dist/backend/{chunk-WBVNGT6C.mjs → chunk-ALCYAWIU.mjs} +5615 -5173
  15. package/dist/backend/{chunk-UFFJTOUP.mjs → chunk-DMYETTMK.mjs} +1 -1
  16. package/dist/backend/{chunk-O2FNE4BV.mjs → chunk-ECPEYFTT.mjs} +7 -7
  17. package/dist/backend/{chunk-MMTTJRJ7.mjs → chunk-QTW6YBAQ.mjs} +790 -1841
  18. package/dist/backend/{chunk-2WFPFKXF.mjs → chunk-UCE7X36J.mjs} +5 -5
  19. package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
  20. package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
  21. package/dist/backend/core/handlers/coreHandler.js +6018 -6627
  22. package/dist/backend/core/handlers/coreHandler.mjs +7 -7
  23. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  25. package/dist/backend/core/handlers/executeRoute.mjs +4 -4
  26. package/dist/backend/core/handlers/handleRouteByName.js +6018 -6627
  27. package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
  28. package/dist/backend/core/handlers/index.d.mts +1 -1
  29. package/dist/backend/core/handlers/index.d.ts +1 -1
  30. package/dist/backend/core/handlers/index.js +6018 -6627
  31. package/dist/backend/core/handlers/index.mjs +10 -10
  32. package/dist/backend/core/index.d.mts +1 -1
  33. package/dist/backend/core/index.d.ts +1 -1
  34. package/dist/backend/core/index.js +6018 -6627
  35. package/dist/backend/core/index.mjs +10 -10
  36. package/dist/backend/core/routes/index.d.mts +1 -1
  37. package/dist/backend/core/routes/index.d.ts +1 -1
  38. package/dist/backend/core/routes/index.js +790 -1841
  39. package/dist/backend/core/routes/index.mjs +2 -2
  40. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  41. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  43. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  44. package/dist/backend/core/routes/routeConfigs.js +790 -1841
  45. package/dist/backend/core/routes/routeConfigs.mjs +2 -2
  46. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  47. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  48. package/dist/backend/core/types/index.d.mts +1 -1
  49. package/dist/backend/core/types/index.d.ts +1 -1
  50. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  51. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  52. package/dist/backend/core/utils/index.mjs +3 -3
  53. package/dist/backend/index.d.mts +2 -2
  54. package/dist/backend/index.d.ts +2 -2
  55. package/dist/backend/index.js +6018 -6627
  56. package/dist/backend/index.mjs +10 -10
  57. package/dist/backend/{routeTypes-B4IhP62O.d.mts → routeTypes-CIyvTbT-.d.mts} +933 -268
  58. package/dist/backend/{routeTypes-Clg-tGZs.d.ts → routeTypes-Dovw-kXS.d.ts} +933 -268
  59. package/dist/better-auth/{chunk-QRHWL7PJ.mjs → chunk-AYUZ7BAL.mjs} +1 -1
  60. package/dist/better-auth/{chunk-ZSPHK3QP.mjs → chunk-MAM2SPNT.mjs} +790 -1841
  61. package/dist/better-auth/{chunk-GHX3KM47.mjs → chunk-RXQY5TZP.mjs} +5616 -5174
  62. package/dist/better-auth/index.js +6247 -6856
  63. package/dist/better-auth/index.mjs +3 -3
  64. package/dist/better-auth/utils/createAutumnEndpoint.js +790 -1841
  65. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  66. package/dist/better-auth/utils/handleBetterAuthRoute.js +6018 -6627
  67. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  68. package/dist/better-auth/utils/index.js +6247 -6856
  69. package/dist/better-auth/utils/index.mjs +3 -3
  70. package/dist/react/AutumnContext.d.mts +4 -4
  71. package/dist/react/AutumnContext.d.ts +4 -4
  72. package/dist/react/client/AutumnClient.d.mts +4 -4
  73. package/dist/react/client/AutumnClient.d.ts +4 -4
  74. package/dist/react/client/IAutumnClient.d.mts +4 -4
  75. package/dist/react/client/IAutumnClient.d.ts +4 -4
  76. package/dist/react/client/index.d.mts +4 -4
  77. package/dist/react/client/index.d.ts +4 -4
  78. package/dist/react/{customer-7v3j-HM8.d.ts → customer-Bp7Npmb4.d.ts} +1 -5
  79. package/dist/react/{customer-B1dHh-Kx.d.mts → customer-Ho7hCUyc.d.mts} +1 -5
  80. package/dist/react/hooks/index.d.mts +4 -4
  81. package/dist/react/hooks/index.d.ts +4 -4
  82. package/dist/react/hooks/index.mjs +5 -5
  83. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  84. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  85. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  86. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  87. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  88. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  89. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  90. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  91. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  92. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  93. package/dist/react/hooks/internal/useCustomerActions.d.mts +4 -4
  94. package/dist/react/hooks/internal/useCustomerActions.d.ts +4 -4
  95. package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
  96. package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
  97. package/dist/react/hooks/useCustomer.d.mts +3 -3
  98. package/dist/react/hooks/useCustomer.d.ts +3 -3
  99. package/dist/react/hooks/useEntity.d.mts +2 -2
  100. package/dist/react/hooks/useEntity.d.ts +2 -2
  101. package/dist/react/hooks/useListEvents.d.mts +2 -2
  102. package/dist/react/hooks/useListEvents.d.ts +2 -2
  103. package/dist/react/hooks/useListPlans.d.mts +3 -3
  104. package/dist/react/hooks/useListPlans.d.ts +3 -3
  105. package/dist/react/hooks/useReferrals.d.mts +2 -2
  106. package/dist/react/hooks/useReferrals.d.ts +2 -2
  107. package/dist/react/index.d.mts +4 -4
  108. package/dist/react/index.d.ts +4 -4
  109. package/dist/react/index.mjs +5 -5
  110. package/dist/react/{list-plans-response-BdNdM3Qx.d.ts → list-plans-response-CN5npYlB.d.mts} +126 -5
  111. package/dist/react/{list-plans-response-CH1VbFIg.d.mts → list-plans-response-ZA4i4qbk.d.ts} +126 -5
  112. package/dist/react/{params-ClWEGYj-.d.mts → params-ChTAunjw.d.ts} +344 -25
  113. package/dist/react/{params-cj_zZr99.d.ts → params-xlsDk_Hb.d.mts} +344 -25
  114. package/dist/react/{plan-Dq6s6t9I.d.mts → plan-CrpW2EZo.d.mts} +52 -5
  115. package/dist/react/{plan-Dq6s6t9I.d.ts → plan-CrpW2EZo.d.ts} +52 -5
  116. package/dist/sdk/index.d.mts +4387 -3312
  117. package/dist/sdk/index.d.ts +4387 -3312
  118. package/dist/sdk/index.js +19203 -18287
  119. package/dist/sdk/index.mjs +19003 -18271
  120. package/package.json +3 -2
  121. package/dist/backend/{chunk-IXUCY7AU.mjs → chunk-MOHYGUMA.mjs} +3 -3
@@ -351,10 +351,6 @@ type BalanceFeature = {
351
351
  * For classic credit systems: maps metered features to flat or graduated credit costs.
352
352
  */
353
353
  creditSchema?: Array<BalanceCreditSchema1 | BalanceCreditSchema2 | BalanceCreditSchema3> | undefined;
354
- /**
355
- * Whether usage of this classic credit system should be itemized as invoice credits.
356
- */
357
- invoiceCredit?: boolean | undefined;
358
354
  /**
359
355
  * Per-model markup overrides for AI credit systems.
360
356
  */
@@ -894,6 +890,17 @@ type PlanItemRollover = {
894
890
  */
895
891
  expiryDurationLength?: number | undefined;
896
892
  };
893
+ declare const ItemDuration: {
894
+ readonly Day: "day";
895
+ readonly Week: "week";
896
+ readonly Month: "month";
897
+ readonly Year: "year";
898
+ };
899
+ type ItemDuration = OpenEnum<typeof ItemDuration>;
900
+ type ItemExpiry = {
901
+ duration: ItemDuration;
902
+ length: number;
903
+ };
897
904
  type PlanDimensionsItem4 = {
898
905
  /**
899
906
  * Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
@@ -1161,6 +1168,10 @@ type Item = {
1161
1168
  * Rollover configuration for unused units. If set, unused included units roll over to the next period.
1162
1169
  */
1163
1170
  rollover?: PlanItemRollover | undefined;
1171
+ /**
1172
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
1173
+ */
1174
+ expiry?: ItemExpiry | null | undefined;
1164
1175
  /**
1165
1176
  * Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema).
1166
1177
  */
@@ -1805,6 +1816,20 @@ type PlanVariantDetailsRollover = {
1805
1816
  */
1806
1817
  expiryDurationLength?: number | undefined;
1807
1818
  };
1819
+ declare const VariantDetailsDuration: {
1820
+ readonly Day: "day";
1821
+ readonly Week: "week";
1822
+ readonly Month: "month";
1823
+ readonly Year: "year";
1824
+ };
1825
+ type VariantDetailsDuration = OpenEnum<typeof VariantDetailsDuration>;
1826
+ /**
1827
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
1828
+ */
1829
+ type VariantDetailsExpiry = {
1830
+ duration: VariantDetailsDuration;
1831
+ length: number;
1832
+ };
1808
1833
  type PlanDimensionsVariantDetails4 = {
1809
1834
  /**
1810
1835
  * Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
@@ -2071,6 +2096,10 @@ type PlanItem = {
2071
2096
  * Rollover config for unused units. If set, unused included units carry over.
2072
2097
  */
2073
2098
  rollover?: PlanVariantDetailsRollover | undefined;
2099
+ /**
2100
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
2101
+ */
2102
+ expiry?: VariantDetailsExpiry | undefined;
2074
2103
  /**
2075
2104
  * Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema).
2076
2105
  */
@@ -2427,6 +2456,7 @@ type PlanVariantDetailsBillingControls1 = {
2427
2456
  */
2428
2457
  overageAllowed?: Array<PlanVariantDetailsOverageAllowed1> | undefined;
2429
2458
  };
2459
+
2430
2460
  /**
2431
2461
  * Billing interval (e.g. 'month', 'year').
2432
2462
  */
@@ -2476,7 +2506,6 @@ type UpsertLicenseBasePrice = {
2476
2506
  type UpsertLicenseThresholdBilling = {
2477
2507
  threshold: number;
2478
2508
  };
2479
-
2480
2509
  /**
2481
2510
  * Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
2482
2511
  */
@@ -2679,6 +2708,20 @@ type PlanUpsertLicenseRollover = {
2679
2708
  */
2680
2709
  expiryDurationLength?: number | undefined;
2681
2710
  };
2711
+ declare const UpsertLicenseDuration: {
2712
+ readonly Day: "day";
2713
+ readonly Week: "week";
2714
+ readonly Month: "month";
2715
+ readonly Year: "year";
2716
+ };
2717
+ type UpsertLicenseDuration = OpenEnum<typeof UpsertLicenseDuration>;
2718
+ /**
2719
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
2720
+ */
2721
+ type UpsertLicenseExpiry = {
2722
+ duration: UpsertLicenseDuration;
2723
+ length: number;
2724
+ };
2682
2725
  type PlanDimensionsUpsertLicense4 = {
2683
2726
  /**
2684
2727
  * Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
@@ -2945,6 +2988,10 @@ type UpsertLicensePlanItem = {
2945
2988
  * Rollover config for unused units. If set, unused included units carry over.
2946
2989
  */
2947
2990
  rollover?: PlanUpsertLicenseRollover | undefined;
2991
+ /**
2992
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
2993
+ */
2994
+ expiry?: UpsertLicenseExpiry | undefined;
2948
2995
  /**
2949
2996
  * Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema).
2950
2997
  */
@@ -351,10 +351,6 @@ type BalanceFeature = {
351
351
  * For classic credit systems: maps metered features to flat or graduated credit costs.
352
352
  */
353
353
  creditSchema?: Array<BalanceCreditSchema1 | BalanceCreditSchema2 | BalanceCreditSchema3> | undefined;
354
- /**
355
- * Whether usage of this classic credit system should be itemized as invoice credits.
356
- */
357
- invoiceCredit?: boolean | undefined;
358
354
  /**
359
355
  * Per-model markup overrides for AI credit systems.
360
356
  */
@@ -894,6 +890,17 @@ type PlanItemRollover = {
894
890
  */
895
891
  expiryDurationLength?: number | undefined;
896
892
  };
893
+ declare const ItemDuration: {
894
+ readonly Day: "day";
895
+ readonly Week: "week";
896
+ readonly Month: "month";
897
+ readonly Year: "year";
898
+ };
899
+ type ItemDuration = OpenEnum<typeof ItemDuration>;
900
+ type ItemExpiry = {
901
+ duration: ItemDuration;
902
+ length: number;
903
+ };
897
904
  type PlanDimensionsItem4 = {
898
905
  /**
899
906
  * Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
@@ -1161,6 +1168,10 @@ type Item = {
1161
1168
  * Rollover configuration for unused units. If set, unused included units roll over to the next period.
1162
1169
  */
1163
1170
  rollover?: PlanItemRollover | undefined;
1171
+ /**
1172
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
1173
+ */
1174
+ expiry?: ItemExpiry | null | undefined;
1164
1175
  /**
1165
1176
  * Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema).
1166
1177
  */
@@ -1805,6 +1816,20 @@ type PlanVariantDetailsRollover = {
1805
1816
  */
1806
1817
  expiryDurationLength?: number | undefined;
1807
1818
  };
1819
+ declare const VariantDetailsDuration: {
1820
+ readonly Day: "day";
1821
+ readonly Week: "week";
1822
+ readonly Month: "month";
1823
+ readonly Year: "year";
1824
+ };
1825
+ type VariantDetailsDuration = OpenEnum<typeof VariantDetailsDuration>;
1826
+ /**
1827
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
1828
+ */
1829
+ type VariantDetailsExpiry = {
1830
+ duration: VariantDetailsDuration;
1831
+ length: number;
1832
+ };
1808
1833
  type PlanDimensionsVariantDetails4 = {
1809
1834
  /**
1810
1835
  * Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
@@ -2071,6 +2096,10 @@ type PlanItem = {
2071
2096
  * Rollover config for unused units. If set, unused included units carry over.
2072
2097
  */
2073
2098
  rollover?: PlanVariantDetailsRollover | undefined;
2099
+ /**
2100
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
2101
+ */
2102
+ expiry?: VariantDetailsExpiry | undefined;
2074
2103
  /**
2075
2104
  * Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema).
2076
2105
  */
@@ -2427,6 +2456,7 @@ type PlanVariantDetailsBillingControls1 = {
2427
2456
  */
2428
2457
  overageAllowed?: Array<PlanVariantDetailsOverageAllowed1> | undefined;
2429
2458
  };
2459
+
2430
2460
  /**
2431
2461
  * Billing interval (e.g. 'month', 'year').
2432
2462
  */
@@ -2476,7 +2506,6 @@ type UpsertLicenseBasePrice = {
2476
2506
  type UpsertLicenseThresholdBilling = {
2477
2507
  threshold: number;
2478
2508
  };
2479
-
2480
2509
  /**
2481
2510
  * Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
2482
2511
  */
@@ -2679,6 +2708,20 @@ type PlanUpsertLicenseRollover = {
2679
2708
  */
2680
2709
  expiryDurationLength?: number | undefined;
2681
2710
  };
2711
+ declare const UpsertLicenseDuration: {
2712
+ readonly Day: "day";
2713
+ readonly Week: "week";
2714
+ readonly Month: "month";
2715
+ readonly Year: "year";
2716
+ };
2717
+ type UpsertLicenseDuration = OpenEnum<typeof UpsertLicenseDuration>;
2718
+ /**
2719
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
2720
+ */
2721
+ type UpsertLicenseExpiry = {
2722
+ duration: UpsertLicenseDuration;
2723
+ length: number;
2724
+ };
2682
2725
  type PlanDimensionsUpsertLicense4 = {
2683
2726
  /**
2684
2727
  * Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
@@ -2945,6 +2988,10 @@ type UpsertLicensePlanItem = {
2945
2988
  * Rollover config for unused units. If set, unused included units carry over.
2946
2989
  */
2947
2990
  rollover?: PlanUpsertLicenseRollover | undefined;
2991
+ /**
2992
+ * Purchased units expire this long after each purchase. One-off prepaid consumable items only.
2993
+ */
2994
+ expiry?: UpsertLicenseExpiry | undefined;
2948
2995
  /**
2949
2996
  * Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema).
2950
2997
  */