autumn-js 1.2.53 → 1.2.55

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 (134) hide show
  1. package/dist/backend/adapters/express.js +4928 -1731
  2. package/dist/backend/adapters/express.mjs +6 -6
  3. package/dist/backend/adapters/fetch.js +4928 -1731
  4. package/dist/backend/adapters/fetch.mjs +6 -6
  5. package/dist/backend/adapters/hono.js +4928 -1731
  6. package/dist/backend/adapters/hono.mjs +6 -6
  7. package/dist/backend/adapters/index.js +4928 -1731
  8. package/dist/backend/adapters/index.mjs +9 -9
  9. package/dist/backend/adapters/next.js +4928 -1731
  10. package/dist/backend/adapters/next.mjs +6 -6
  11. package/dist/backend/{chunk-QZGNWKGU.mjs → chunk-4SLVJJQ3.mjs} +415 -149
  12. package/dist/backend/{chunk-UO2U5YHG.mjs → chunk-6O2BRQQG.mjs} +1 -1
  13. package/dist/backend/{chunk-BZJMZLRO.mjs → chunk-CTDUPQOB.mjs} +2 -2
  14. package/dist/backend/{chunk-DUWBM6AP.mjs → chunk-HBCBE5EZ.mjs} +2 -2
  15. package/dist/backend/{chunk-G5BNVBAL.mjs → chunk-QP3VSL4U.mjs} +1 -1
  16. package/dist/backend/{chunk-6HGIR6SI.mjs → chunk-V6O5INQW.mjs} +1 -1
  17. package/dist/backend/{chunk-QEMMOYX7.mjs → chunk-W4YHYDGM.mjs} +1 -1
  18. package/dist/backend/{chunk-AKZ3LI43.mjs → chunk-Z3CFUICE.mjs} +4513 -1582
  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 +4928 -1731
  22. package/dist/backend/core/handlers/coreHandler.mjs +4 -4
  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 +1 -1
  26. package/dist/backend/core/handlers/handleRouteByName.js +4928 -1731
  27. package/dist/backend/core/handlers/handleRouteByName.mjs +4 -4
  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 +4928 -1731
  31. package/dist/backend/core/handlers/index.mjs +5 -5
  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 +4928 -1731
  35. package/dist/backend/core/index.mjs +7 -7
  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 +415 -149
  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 +415 -149
  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 +4928 -1731
  56. package/dist/backend/index.mjs +7 -7
  57. package/dist/backend/{routeTypes-jEkjrH2F.d.mts → routeTypes-BDnJulPJ.d.mts} +4748 -1657
  58. package/dist/backend/{routeTypes-C9oAOQtZ.d.ts → routeTypes-Cx-p8x5O.d.ts} +4748 -1657
  59. package/dist/better-auth/{chunk-56PNBTLH.mjs → chunk-EVKS2OKA.mjs} +1 -1
  60. package/dist/better-auth/{chunk-AI73OSOF.mjs → chunk-JQU4W6BA.mjs} +4514 -1583
  61. package/dist/better-auth/{chunk-IIOL3QPN.mjs → chunk-ODDA4I3O.mjs} +415 -149
  62. package/dist/better-auth/index.js +4928 -1731
  63. package/dist/better-auth/index.mjs +3 -3
  64. package/dist/better-auth/utils/createAutumnEndpoint.js +415 -149
  65. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  66. package/dist/better-auth/utils/handleBetterAuthRoute.js +4928 -1731
  67. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  68. package/dist/better-auth/utils/index.js +4928 -1731
  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/{chunk-CQF3ER2L.mjs → chunk-JV4GHJ4W.mjs} +1 -1
  73. package/dist/react/{chunk-D6DFRS3U.mjs → chunk-NDHIXCZM.mjs} +2 -1
  74. package/dist/react/{chunk-BWKG32GC.mjs → chunk-Q7HVHWDK.mjs} +1 -1
  75. package/dist/react/{chunk-LUBYNTYC.mjs → chunk-VKY4SZNZ.mjs} +1 -1
  76. package/dist/react/client/AutumnClient.d.mts +4 -4
  77. package/dist/react/client/AutumnClient.d.ts +4 -4
  78. package/dist/react/client/IAutumnClient.d.mts +4 -4
  79. package/dist/react/client/IAutumnClient.d.ts +4 -4
  80. package/dist/react/client/index.d.mts +4 -4
  81. package/dist/react/client/index.d.ts +4 -4
  82. package/dist/react/{customer-4XLHVIIG.d.mts → customer-DyNLAM-_.d.ts} +74 -9
  83. package/dist/react/{customer-CPv9i8iR.d.ts → customer-Dz1Fr6nJ.d.mts} +74 -9
  84. package/dist/react/hooks/index.d.mts +4 -4
  85. package/dist/react/hooks/index.d.ts +4 -4
  86. package/dist/react/hooks/index.js +2 -1
  87. package/dist/react/hooks/index.mjs +4 -4
  88. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  89. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  90. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  91. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  92. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  93. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  94. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  95. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  96. package/dist/react/hooks/internal/check/getCreditCost.js +2 -1
  97. package/dist/react/hooks/internal/check/getCreditCost.mjs +1 -1
  98. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  99. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  100. package/dist/react/hooks/internal/getLocalCheckResponse.js +2 -1
  101. package/dist/react/hooks/internal/getLocalCheckResponse.mjs +2 -2
  102. package/dist/react/hooks/internal/useCustomerActions.d.mts +4 -4
  103. package/dist/react/hooks/internal/useCustomerActions.d.ts +4 -4
  104. package/dist/react/hooks/internal/useCustomerActions.js +2 -1
  105. package/dist/react/hooks/internal/useCustomerActions.mjs +3 -3
  106. package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
  107. package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
  108. package/dist/react/hooks/useCustomer.d.mts +3 -3
  109. package/dist/react/hooks/useCustomer.d.ts +3 -3
  110. package/dist/react/hooks/useCustomer.js +2 -1
  111. package/dist/react/hooks/useCustomer.mjs +4 -4
  112. package/dist/react/hooks/useEntity.d.mts +2 -2
  113. package/dist/react/hooks/useEntity.d.ts +2 -2
  114. package/dist/react/hooks/useListEvents.d.mts +2 -2
  115. package/dist/react/hooks/useListEvents.d.ts +2 -2
  116. package/dist/react/hooks/useListPlans.d.mts +3 -3
  117. package/dist/react/hooks/useListPlans.d.ts +3 -3
  118. package/dist/react/hooks/useReferrals.d.mts +2 -2
  119. package/dist/react/hooks/useReferrals.d.ts +2 -2
  120. package/dist/react/index.d.mts +4 -4
  121. package/dist/react/index.d.ts +4 -4
  122. package/dist/react/index.js +2 -1
  123. package/dist/react/index.mjs +4 -4
  124. package/dist/react/{list-plans-op-Dsryi9lT.d.mts → list-plans-op-DTkteoH6.d.ts} +656 -468
  125. package/dist/react/{list-plans-op-jsAtkFHJ.d.ts → list-plans-op-ZRs2lBAB.d.mts} +656 -468
  126. package/dist/react/{params-BGfGRnue.d.ts → params-BiUwODRL.d.mts} +628 -86
  127. package/dist/react/{params-DPSGMHHa.d.mts → params-DIglFpGj.d.ts} +628 -86
  128. package/dist/react/{plan-DEGPMYmh.d.mts → plan-C96AilzT.d.mts} +798 -374
  129. package/dist/react/{plan-DEGPMYmh.d.ts → plan-C96AilzT.d.ts} +798 -374
  130. package/dist/sdk/index.d.mts +6891 -2819
  131. package/dist/sdk/index.d.ts +6891 -2819
  132. package/dist/sdk/index.js +6582 -1771
  133. package/dist/sdk/index.mjs +5949 -1670
  134. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
1
  import "../chunk-HIWOK3G6.mjs";
2
2
  import {
3
3
  createAutumnEndpoint
4
- } from "../chunk-56PNBTLH.mjs";
4
+ } from "../chunk-EVKS2OKA.mjs";
5
5
  import {
6
6
  createHandleBetterAuthRoute
7
- } from "../chunk-AI73OSOF.mjs";
7
+ } from "../chunk-JQU4W6BA.mjs";
8
8
  import {
9
9
  resolveIdentityFromScope
10
10
  } from "../chunk-J2WYVGHS.mjs";
11
- import "../chunk-IIOL3QPN.mjs";
11
+ import "../chunk-ODDA4I3O.mjs";
12
12
  import {
13
13
  getActiveOrganization
14
14
  } from "../chunk-BT3EAYVW.mjs";
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { IAutumnClient } from './client/IAutumnClient.mjs';
3
- import './params-DPSGMHHa.mjs';
4
- import './plan-DEGPMYmh.mjs';
5
- import './customer-4XLHVIIG.mjs';
6
- import './list-plans-op-Dsryi9lT.mjs';
3
+ import './params-BiUwODRL.mjs';
4
+ import './plan-C96AilzT.mjs';
5
+ import './customer-Dz1Fr6nJ.mjs';
6
+ import './list-plans-op-ZRs2lBAB.mjs';
7
7
 
8
8
  type AutumnContextValue = {
9
9
  client: IAutumnClient;
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { IAutumnClient } from './client/IAutumnClient.js';
3
- import './params-BGfGRnue.js';
4
- import './plan-DEGPMYmh.js';
5
- import './customer-CPv9i8iR.js';
6
- import './list-plans-op-jsAtkFHJ.js';
3
+ import './params-DIglFpGj.js';
4
+ import './plan-C96AilzT.js';
5
+ import './customer-DyNLAM-_.js';
6
+ import './list-plans-op-DTkteoH6.js';
7
7
 
8
8
  type AutumnContextValue = {
9
9
  client: IAutumnClient;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useCustomerActions
4
- } from "./chunk-LUBYNTYC.mjs";
4
+ } from "./chunk-VKY4SZNZ.mjs";
5
5
  import {
6
6
  useQuery
7
7
  } from "./chunk-KCOHZSS3.mjs";
@@ -12,7 +12,8 @@ var getCreditCost = ({
12
12
  const schemaItem = creditSystem.creditSchema?.find(
13
13
  (schema) => schema.meteredFeatureId === featureId
14
14
  );
15
- return amount * (schemaItem?.creditCost ?? 1);
15
+ const creditCost = schemaItem && "creditCost" in schemaItem ? schemaItem.creditCost : 1;
16
+ return amount * (creditCost ?? 1);
16
17
  };
17
18
 
18
19
  export {
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-4TON573W.mjs";
11
11
  import {
12
12
  getCreditCost
13
- } from "./chunk-D6DFRS3U.mjs";
13
+ } from "./chunk-NDHIXCZM.mjs";
14
14
 
15
15
  // src/react/hooks/internal/getLocalCheckResponse.ts
16
16
  var getFeatureToUse = ({
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  getLocalCheckResponse
4
- } from "./chunk-BWKG32GC.mjs";
4
+ } from "./chunk-Q7HVHWDK.mjs";
5
5
  import {
6
6
  useQueryClient
7
7
  } from "./chunk-KCOHZSS3.mjs";
@@ -1,8 +1,8 @@
1
1
  import { IAutumnClient } from './IAutumnClient.mjs';
2
- import '../params-DPSGMHHa.mjs';
3
- import '../plan-DEGPMYmh.mjs';
4
- import '../customer-4XLHVIIG.mjs';
5
- import '../list-plans-op-Dsryi9lT.mjs';
2
+ import '../params-BiUwODRL.mjs';
3
+ import '../plan-C96AilzT.mjs';
4
+ import '../customer-Dz1Fr6nJ.mjs';
5
+ import '../list-plans-op-ZRs2lBAB.mjs';
6
6
 
7
7
  /** Configuration for Autumn client */
8
8
  type AutumnClientConfig = {
@@ -1,8 +1,8 @@
1
1
  import { IAutumnClient } from './IAutumnClient.js';
2
- import '../params-BGfGRnue.js';
3
- import '../plan-DEGPMYmh.js';
4
- import '../customer-CPv9i8iR.js';
5
- import '../list-plans-op-jsAtkFHJ.js';
2
+ import '../params-DIglFpGj.js';
3
+ import '../plan-C96AilzT.js';
4
+ import '../customer-DyNLAM-_.js';
5
+ import '../list-plans-op-DTkteoH6.js';
6
6
 
7
7
  /** Configuration for Autumn client */
8
8
  type AutumnClientConfig = {
@@ -1,7 +1,7 @@
1
- import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-DPSGMHHa.mjs';
2
- import { C as Customer } from '../customer-4XLHVIIG.mjs';
3
- import { L as ListPlansResponse } from '../list-plans-op-Dsryi9lT.mjs';
4
- import '../plan-DEGPMYmh.mjs';
1
+ import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-BiUwODRL.mjs';
2
+ import { C as Customer } from '../customer-Dz1Fr6nJ.mjs';
3
+ import { L as ListPlansResponse } from '../list-plans-op-ZRs2lBAB.mjs';
4
+ import '../plan-C96AilzT.mjs';
5
5
 
6
6
  /** Client interface matching backend RPC routes */
7
7
  interface IAutumnClient {
@@ -1,7 +1,7 @@
1
- import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-BGfGRnue.js';
2
- import { C as Customer } from '../customer-CPv9i8iR.js';
3
- import { L as ListPlansResponse } from '../list-plans-op-jsAtkFHJ.js';
4
- import '../plan-DEGPMYmh.js';
1
+ import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-DIglFpGj.js';
2
+ import { C as Customer } from '../customer-DyNLAM-_.js';
3
+ import { L as ListPlansResponse } from '../list-plans-op-DTkteoH6.js';
4
+ import '../plan-C96AilzT.js';
5
5
 
6
6
  /** Client interface matching backend RPC routes */
7
7
  interface IAutumnClient {
@@ -1,7 +1,7 @@
1
1
  export { AutumnClientConfig, createAutumnClient } from './AutumnClient.mjs';
2
2
  export { AutumnClientError } from './AutumnClientError.mjs';
3
3
  export { IAutumnClient } from './IAutumnClient.mjs';
4
- import '../params-DPSGMHHa.mjs';
5
- import '../plan-DEGPMYmh.mjs';
6
- import '../customer-4XLHVIIG.mjs';
7
- import '../list-plans-op-Dsryi9lT.mjs';
4
+ import '../params-BiUwODRL.mjs';
5
+ import '../plan-C96AilzT.mjs';
6
+ import '../customer-Dz1Fr6nJ.mjs';
7
+ import '../list-plans-op-ZRs2lBAB.mjs';
@@ -1,7 +1,7 @@
1
1
  export { AutumnClientConfig, createAutumnClient } from './AutumnClient.js';
2
2
  export { AutumnClientError } from './AutumnClientError.js';
3
3
  export { IAutumnClient } from './IAutumnClient.js';
4
- import '../params-BGfGRnue.js';
5
- import '../plan-DEGPMYmh.js';
6
- import '../customer-CPv9i8iR.js';
7
- import '../list-plans-op-jsAtkFHJ.js';
4
+ import '../params-DIglFpGj.js';
5
+ import '../plan-C96AilzT.js';
6
+ import '../customer-DyNLAM-_.js';
7
+ import '../list-plans-op-DTkteoH6.js';
@@ -1,4 +1,4 @@
1
- import { O as OpenEnum, P as Plan, a as Balance } from './plan-DEGPMYmh.mjs';
1
+ import { O as OpenEnum, P as Plan, a as Balance, C as ClosedEnum } from './plan-C96AilzT.js';
2
2
 
3
3
  /**
4
4
  * The environment this customer was created in.
@@ -491,16 +491,57 @@ declare const CustomerFlagsType: {
491
491
  * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools, 'ai_credit_system' for model-based token pricing.
492
492
  */
493
493
  type CustomerFlagsType = OpenEnum<typeof CustomerFlagsType>;
494
- type CustomerCreditSchema = {
494
+ type CustomerCreditSchema3 = {
495
+ meteredFeatureId: "";
496
+ /**
497
+ * Number of metered-feature units priced together. Defaults to one when omitted.
498
+ */
499
+ billingUnits?: number | undefined;
500
+ /**
501
+ * Credits consumed per billing-unit group.
502
+ */
503
+ creditCost: number;
504
+ };
505
+ type CustomerCreditSchema2 = {
495
506
  /**
496
507
  * ID of the metered feature that draws from this credit system.
497
508
  */
498
509
  meteredFeatureId: string;
499
510
  /**
500
- * Credits consumed per unit of the metered feature.
511
+ * Number of metered-feature units priced together. Defaults to one when omitted.
512
+ */
513
+ billingUnits?: number | undefined;
514
+ /**
515
+ * Credits consumed per billing-unit group.
501
516
  */
502
517
  creditCost: number;
503
518
  };
519
+ declare const CustomerToEnum: {
520
+ readonly Inf: "inf";
521
+ };
522
+ type CustomerToEnum = ClosedEnum<typeof CustomerToEnum>;
523
+ type CustomerTier = {
524
+ /**
525
+ * Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
526
+ */
527
+ to: number | CustomerToEnum;
528
+ /**
529
+ * Credits consumed per billing-unit group within this tier.
530
+ */
531
+ creditCost: number;
532
+ };
533
+ type CustomerCreditSchema1 = {
534
+ /**
535
+ * ID of the metered feature that draws from this credit system.
536
+ */
537
+ meteredFeatureId: string;
538
+ /**
539
+ * Number of metered-feature units priced together. Defaults to one when omitted.
540
+ */
541
+ billingUnits?: number | undefined;
542
+ tierBehavior: "graduated";
543
+ tiers: Array<CustomerTier>;
544
+ };
504
545
  type CustomerModelMarkups = {
505
546
  markup?: number | undefined;
506
547
  inputCost?: number | undefined;
@@ -522,6 +563,22 @@ type CustomerDisplay = {
522
563
  */
523
564
  plural?: string | null | undefined;
524
565
  };
566
+ type CustomerFlagsStripe = {
567
+ /**
568
+ * Stripe product ID this feature's usage prices bill under.
569
+ */
570
+ productId?: string | undefined;
571
+ /**
572
+ * Stripe meter ID used to create this feature's metered price.
573
+ */
574
+ meterId?: string | undefined;
575
+ };
576
+ /**
577
+ * Processor mappings for this feature. Present when a Stripe product or meter is set.
578
+ */
579
+ type CustomerFlagsProcessors = {
580
+ stripe?: CustomerFlagsStripe | undefined;
581
+ };
525
582
  /**
526
583
  * The full feature object if expanded.
527
584
  */
@@ -547,9 +604,13 @@ type CustomerFeature = {
547
604
  */
548
605
  eventNames?: Array<string> | undefined;
549
606
  /**
550
- * For credit_system features: maps metered features to their credit costs.
607
+ * For classic credit systems: maps metered features to flat or graduated credit costs.
551
608
  */
552
- creditSchema?: Array<CustomerCreditSchema> | undefined;
609
+ creditSchema?: Array<CustomerCreditSchema1 | CustomerCreditSchema2 | CustomerCreditSchema3> | undefined;
610
+ /**
611
+ * Whether usage of this classic credit system should be itemized as invoice credits.
612
+ */
613
+ invoiceCredit?: boolean | undefined;
553
614
  /**
554
615
  * Per-model markup overrides for AI credit systems.
555
616
  */
@@ -574,6 +635,10 @@ type CustomerFeature = {
574
635
  * Whether the feature is archived and hidden from the dashboard.
575
636
  */
576
637
  archived: boolean;
638
+ /**
639
+ * Processor mappings for this feature. Present when a Stripe product or meter is set.
640
+ */
641
+ processors?: CustomerFlagsProcessors | undefined;
577
642
  };
578
643
  type Flags = {
579
644
  /**
@@ -613,7 +678,7 @@ type CustomerConfig = {
613
678
  /**
614
679
  * Stripe processor connection for the customer.
615
680
  */
616
- type Stripe = {
681
+ type CustomerStripe = {
617
682
  /**
618
683
  * Stripe customer ID.
619
684
  */
@@ -644,11 +709,11 @@ type Revenuecat = {
644
709
  /**
645
710
  * Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
646
711
  */
647
- type Processors = {
712
+ type CustomerProcessors = {
648
713
  /**
649
714
  * Stripe processor connection for the customer.
650
715
  */
651
- stripe?: Stripe | undefined;
716
+ stripe?: CustomerStripe | undefined;
652
717
  /**
653
718
  * Vercel processor connection for the customer (public-safe subset).
654
719
  */
@@ -991,7 +1056,7 @@ type Customer = {
991
1056
  /**
992
1057
  * Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
993
1058
  */
994
- processors?: Processors | undefined;
1059
+ processors?: CustomerProcessors | undefined;
995
1060
  /**
996
1061
  * Invoices for this customer.
997
1062
  */
@@ -1,4 +1,4 @@
1
- import { O as OpenEnum, P as Plan, a as Balance } from './plan-DEGPMYmh.js';
1
+ import { O as OpenEnum, P as Plan, a as Balance, C as ClosedEnum } from './plan-C96AilzT.mjs';
2
2
 
3
3
  /**
4
4
  * The environment this customer was created in.
@@ -491,16 +491,57 @@ declare const CustomerFlagsType: {
491
491
  * Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools, 'ai_credit_system' for model-based token pricing.
492
492
  */
493
493
  type CustomerFlagsType = OpenEnum<typeof CustomerFlagsType>;
494
- type CustomerCreditSchema = {
494
+ type CustomerCreditSchema3 = {
495
+ meteredFeatureId: "";
496
+ /**
497
+ * Number of metered-feature units priced together. Defaults to one when omitted.
498
+ */
499
+ billingUnits?: number | undefined;
500
+ /**
501
+ * Credits consumed per billing-unit group.
502
+ */
503
+ creditCost: number;
504
+ };
505
+ type CustomerCreditSchema2 = {
495
506
  /**
496
507
  * ID of the metered feature that draws from this credit system.
497
508
  */
498
509
  meteredFeatureId: string;
499
510
  /**
500
- * Credits consumed per unit of the metered feature.
511
+ * Number of metered-feature units priced together. Defaults to one when omitted.
512
+ */
513
+ billingUnits?: number | undefined;
514
+ /**
515
+ * Credits consumed per billing-unit group.
501
516
  */
502
517
  creditCost: number;
503
518
  };
519
+ declare const CustomerToEnum: {
520
+ readonly Inf: "inf";
521
+ };
522
+ type CustomerToEnum = ClosedEnum<typeof CustomerToEnum>;
523
+ type CustomerTier = {
524
+ /**
525
+ * Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
526
+ */
527
+ to: number | CustomerToEnum;
528
+ /**
529
+ * Credits consumed per billing-unit group within this tier.
530
+ */
531
+ creditCost: number;
532
+ };
533
+ type CustomerCreditSchema1 = {
534
+ /**
535
+ * ID of the metered feature that draws from this credit system.
536
+ */
537
+ meteredFeatureId: string;
538
+ /**
539
+ * Number of metered-feature units priced together. Defaults to one when omitted.
540
+ */
541
+ billingUnits?: number | undefined;
542
+ tierBehavior: "graduated";
543
+ tiers: Array<CustomerTier>;
544
+ };
504
545
  type CustomerModelMarkups = {
505
546
  markup?: number | undefined;
506
547
  inputCost?: number | undefined;
@@ -522,6 +563,22 @@ type CustomerDisplay = {
522
563
  */
523
564
  plural?: string | null | undefined;
524
565
  };
566
+ type CustomerFlagsStripe = {
567
+ /**
568
+ * Stripe product ID this feature's usage prices bill under.
569
+ */
570
+ productId?: string | undefined;
571
+ /**
572
+ * Stripe meter ID used to create this feature's metered price.
573
+ */
574
+ meterId?: string | undefined;
575
+ };
576
+ /**
577
+ * Processor mappings for this feature. Present when a Stripe product or meter is set.
578
+ */
579
+ type CustomerFlagsProcessors = {
580
+ stripe?: CustomerFlagsStripe | undefined;
581
+ };
525
582
  /**
526
583
  * The full feature object if expanded.
527
584
  */
@@ -547,9 +604,13 @@ type CustomerFeature = {
547
604
  */
548
605
  eventNames?: Array<string> | undefined;
549
606
  /**
550
- * For credit_system features: maps metered features to their credit costs.
607
+ * For classic credit systems: maps metered features to flat or graduated credit costs.
551
608
  */
552
- creditSchema?: Array<CustomerCreditSchema> | undefined;
609
+ creditSchema?: Array<CustomerCreditSchema1 | CustomerCreditSchema2 | CustomerCreditSchema3> | undefined;
610
+ /**
611
+ * Whether usage of this classic credit system should be itemized as invoice credits.
612
+ */
613
+ invoiceCredit?: boolean | undefined;
553
614
  /**
554
615
  * Per-model markup overrides for AI credit systems.
555
616
  */
@@ -574,6 +635,10 @@ type CustomerFeature = {
574
635
  * Whether the feature is archived and hidden from the dashboard.
575
636
  */
576
637
  archived: boolean;
638
+ /**
639
+ * Processor mappings for this feature. Present when a Stripe product or meter is set.
640
+ */
641
+ processors?: CustomerFlagsProcessors | undefined;
577
642
  };
578
643
  type Flags = {
579
644
  /**
@@ -613,7 +678,7 @@ type CustomerConfig = {
613
678
  /**
614
679
  * Stripe processor connection for the customer.
615
680
  */
616
- type Stripe = {
681
+ type CustomerStripe = {
617
682
  /**
618
683
  * Stripe customer ID.
619
684
  */
@@ -644,11 +709,11 @@ type Revenuecat = {
644
709
  /**
645
710
  * Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
646
711
  */
647
- type Processors = {
712
+ type CustomerProcessors = {
648
713
  /**
649
714
  * Stripe processor connection for the customer.
650
715
  */
651
- stripe?: Stripe | undefined;
716
+ stripe?: CustomerStripe | undefined;
652
717
  /**
653
718
  * Vercel processor connection for the customer (public-safe subset).
654
719
  */
@@ -991,7 +1056,7 @@ type Customer = {
991
1056
  /**
992
1057
  * Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
993
1058
  */
994
- processors?: Processors | undefined;
1059
+ processors?: CustomerProcessors | undefined;
995
1060
  /**
996
1061
  * Invoices for this customer.
997
1062
  */
@@ -7,7 +7,7 @@ export { UseListPlansParams, useListPlans } from './useListPlans.mjs';
7
7
  export { UseReferralsParams, UseReferralsResult, useReferrals } from './useReferrals.mjs';
8
8
  import '@tanstack/react-query';
9
9
  import '../client/AutumnClientError.mjs';
10
- import '../params-DPSGMHHa.mjs';
11
- import '../plan-DEGPMYmh.mjs';
12
- import '../customer-4XLHVIIG.mjs';
13
- import '../list-plans-op-Dsryi9lT.mjs';
10
+ import '../params-BiUwODRL.mjs';
11
+ import '../plan-C96AilzT.mjs';
12
+ import '../customer-Dz1Fr6nJ.mjs';
13
+ import '../list-plans-op-ZRs2lBAB.mjs';
@@ -7,7 +7,7 @@ export { UseListPlansParams, useListPlans } from './useListPlans.js';
7
7
  export { UseReferralsParams, UseReferralsResult, useReferrals } from './useReferrals.js';
8
8
  import '@tanstack/react-query';
9
9
  import '../client/AutumnClientError.js';
10
- import '../params-BGfGRnue.js';
11
- import '../plan-DEGPMYmh.js';
12
- import '../customer-CPv9i8iR.js';
13
- import '../list-plans-op-jsAtkFHJ.js';
10
+ import '../params-DIglFpGj.js';
11
+ import '../plan-C96AilzT.js';
12
+ import '../customer-DyNLAM-_.js';
13
+ import '../list-plans-op-DTkteoH6.js';
@@ -1282,7 +1282,8 @@ var getCreditCost = ({
1282
1282
  const schemaItem = creditSystem.creditSchema?.find(
1283
1283
  (schema) => schema.meteredFeatureId === featureId
1284
1284
  );
1285
- return amount * (schemaItem?.creditCost ?? 1);
1285
+ const creditCost = schemaItem && "creditCost" in schemaItem ? schemaItem.creditCost : 1;
1286
+ return amount * (creditCost ?? 1);
1286
1287
  };
1287
1288
 
1288
1289
  // src/react/hooks/internal/getLocalCheckResponse.ts
@@ -4,13 +4,13 @@ import {
4
4
  } from "../chunk-RTZAB46K.mjs";
5
5
  import {
6
6
  useCustomer
7
- } from "../chunk-CQF3ER2L.mjs";
8
- import "../chunk-LUBYNTYC.mjs";
9
- import "../chunk-BWKG32GC.mjs";
7
+ } from "../chunk-JV4GHJ4W.mjs";
8
+ import "../chunk-VKY4SZNZ.mjs";
9
+ import "../chunk-Q7HVHWDK.mjs";
10
10
  import "../chunk-GSJF6P3Q.mjs";
11
11
  import "../chunk-SEQHNPTF.mjs";
12
12
  import "../chunk-4TON573W.mjs";
13
- import "../chunk-D6DFRS3U.mjs";
13
+ import "../chunk-NDHIXCZM.mjs";
14
14
  import {
15
15
  useEntity
16
16
  } from "../chunk-7SRCZYRC.mjs";
@@ -1,5 +1,5 @@
1
- import { C as Customer } from '../../../customer-4XLHVIIG.mjs';
2
- import '../../../plan-DEGPMYmh.mjs';
1
+ import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
2
+ import '../../../plan-C96AilzT.mjs';
3
3
 
4
4
  type CustomerBalance = Customer["balances"][string];
5
5
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
@@ -1,5 +1,5 @@
1
- import { C as Customer } from '../../../customer-CPv9i8iR.js';
2
- import '../../../plan-DEGPMYmh.js';
1
+ import { C as Customer } from '../../../customer-DyNLAM-_.js';
2
+ import '../../../plan-C96AilzT.js';
3
3
 
4
4
  type CustomerBalance = Customer["balances"][string];
5
5
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
@@ -1,5 +1,5 @@
1
- import { C as Customer } from '../../../customer-4XLHVIIG.mjs';
2
- import '../../../plan-DEGPMYmh.mjs';
1
+ import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
2
+ import '../../../plan-C96AilzT.mjs';
3
3
 
4
4
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
5
5
  declare const customerToFeatures: ({ customer, }: {
@@ -1,5 +1,5 @@
1
- import { C as Customer } from '../../../customer-CPv9i8iR.js';
2
- import '../../../plan-DEGPMYmh.js';
1
+ import { C as Customer } from '../../../customer-DyNLAM-_.js';
2
+ import '../../../plan-C96AilzT.js';
3
3
 
4
4
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
5
5
  declare const customerToFeatures: ({ customer, }: {
@@ -1,5 +1,5 @@
1
- import { B as BalanceFeature } from '../../../plan-DEGPMYmh.mjs';
2
- import { C as Customer } from '../../../customer-4XLHVIIG.mjs';
1
+ import { B as BalanceFeature } from '../../../plan-C96AilzT.mjs';
2
+ import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
3
3
 
4
4
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
5
5
  declare const findCreditSystemsByFeature: ({ featureId, features, }: {
@@ -1,5 +1,5 @@
1
- import { B as BalanceFeature } from '../../../plan-DEGPMYmh.js';
2
- import { C as Customer } from '../../../customer-CPv9i8iR.js';
1
+ import { B as BalanceFeature } from '../../../plan-C96AilzT.js';
2
+ import { C as Customer } from '../../../customer-DyNLAM-_.js';
3
3
 
4
4
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
5
5
  declare const findCreditSystemsByFeature: ({ featureId, features, }: {
@@ -1,5 +1,5 @@
1
- import { C as Customer } from '../../../customer-4XLHVIIG.mjs';
2
- import '../../../plan-DEGPMYmh.mjs';
1
+ import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
2
+ import '../../../plan-C96AilzT.mjs';
3
3
 
4
4
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
5
5
  declare const getCreditCost: ({ featureId, creditSystem, amount, }: {
@@ -1,5 +1,5 @@
1
- import { C as Customer } from '../../../customer-CPv9i8iR.js';
2
- import '../../../plan-DEGPMYmh.js';
1
+ import { C as Customer } from '../../../customer-DyNLAM-_.js';
2
+ import '../../../plan-C96AilzT.js';
3
3
 
4
4
  type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
5
5
  declare const getCreditCost: ({ featureId, creditSystem, amount, }: {
@@ -35,7 +35,8 @@ var getCreditCost = ({
35
35
  const schemaItem = creditSystem.creditSchema?.find(
36
36
  (schema) => schema.meteredFeatureId === featureId
37
37
  );
38
- return amount * (schemaItem?.creditCost ?? 1);
38
+ const creditCost = schemaItem && "creditCost" in schemaItem ? schemaItem.creditCost : 1;
39
+ return amount * (creditCost ?? 1);
39
40
  };
40
41
  // Annotate the CommonJS export names for ESM import in node:
41
42
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  getCreditCost
4
- } from "../../../chunk-D6DFRS3U.mjs";
4
+ } from "../../../chunk-NDHIXCZM.mjs";
5
5
  export {
6
6
  getCreditCost
7
7
  };
@@ -1,6 +1,6 @@
1
- import { n as ClientCheckParams, o as CheckResponse } from '../../params-DPSGMHHa.mjs';
2
- import { C as Customer } from '../../customer-4XLHVIIG.mjs';
3
- import '../../plan-DEGPMYmh.mjs';
1
+ import { n as ClientCheckParams, o as CheckResponse } from '../../params-BiUwODRL.mjs';
2
+ import { C as Customer } from '../../customer-Dz1Fr6nJ.mjs';
3
+ import '../../plan-C96AilzT.mjs';
4
4
 
5
5
  declare const getLocalCheckResponse: ({ customer, params, }: {
6
6
  customer: Customer | null;
@@ -1,6 +1,6 @@
1
- import { n as ClientCheckParams, o as CheckResponse } from '../../params-BGfGRnue.js';
2
- import { C as Customer } from '../../customer-CPv9i8iR.js';
3
- import '../../plan-DEGPMYmh.js';
1
+ import { n as ClientCheckParams, o as CheckResponse } from '../../params-DIglFpGj.js';
2
+ import { C as Customer } from '../../customer-DyNLAM-_.js';
3
+ import '../../plan-C96AilzT.js';
4
4
 
5
5
  declare const getLocalCheckResponse: ({ customer, params, }: {
6
6
  customer: Customer | null;