autumn-js 1.2.32 → 1.2.34

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 (167) hide show
  1. package/dist/backend/adapters/express.d.mts +1 -1
  2. package/dist/backend/adapters/express.d.ts +1 -1
  3. package/dist/backend/adapters/express.js +13482 -7722
  4. package/dist/backend/adapters/express.mjs +5 -5
  5. package/dist/backend/adapters/fetch.d.mts +1 -1
  6. package/dist/backend/adapters/fetch.d.ts +1 -1
  7. package/dist/backend/adapters/fetch.js +13482 -7722
  8. package/dist/backend/adapters/fetch.mjs +5 -5
  9. package/dist/backend/adapters/hono.d.mts +1 -1
  10. package/dist/backend/adapters/hono.d.ts +1 -1
  11. package/dist/backend/adapters/hono.js +13482 -7722
  12. package/dist/backend/adapters/hono.mjs +5 -5
  13. package/dist/backend/adapters/index.d.mts +1 -1
  14. package/dist/backend/adapters/index.d.ts +1 -1
  15. package/dist/backend/adapters/index.js +13482 -7722
  16. package/dist/backend/adapters/index.mjs +8 -8
  17. package/dist/backend/adapters/next.d.mts +1 -1
  18. package/dist/backend/adapters/next.d.ts +1 -1
  19. package/dist/backend/adapters/next.js +13482 -7722
  20. package/dist/backend/adapters/next.mjs +5 -5
  21. package/dist/backend/{authTypes-Bx2brfr_.d.mts → authTypes-DEBvnrRj.d.mts} +20 -1
  22. package/dist/backend/{authTypes-Bx2brfr_.d.ts → authTypes-DEBvnrRj.d.ts} +20 -1
  23. package/dist/backend/{chunk-UYURZ75E.mjs → chunk-4LKEHLXR.mjs} +704 -41
  24. package/dist/backend/{chunk-W7MG3LB3.mjs → chunk-7MRAUIPE.mjs} +1 -1
  25. package/dist/backend/{chunk-7MPQ5TCH.mjs → chunk-DDRD5BKK.mjs} +2 -2
  26. package/dist/backend/{chunk-Z7WSDAEZ.mjs → chunk-EQJ5B7OA.mjs} +13165 -8068
  27. package/dist/backend/{chunk-AYS6GLVO.mjs → chunk-HMGGMVFC.mjs} +1 -1
  28. package/dist/backend/{chunk-5QIIBIZY.mjs → chunk-KXRDZE5L.mjs} +2 -2
  29. package/dist/backend/{chunk-MXD3NPQK.mjs → chunk-SA6MCT5X.mjs} +1 -1
  30. package/dist/backend/{chunk-NSAJNDTG.mjs → chunk-WCZLA72P.mjs} +1 -1
  31. package/dist/backend/core/handlers/coreHandler.d.mts +2 -2
  32. package/dist/backend/core/handlers/coreHandler.d.ts +2 -2
  33. package/dist/backend/core/handlers/coreHandler.js +13482 -7722
  34. package/dist/backend/core/handlers/coreHandler.mjs +3 -3
  35. package/dist/backend/core/handlers/executeRoute.d.mts +2 -2
  36. package/dist/backend/core/handlers/executeRoute.d.ts +2 -2
  37. package/dist/backend/core/handlers/handleRouteByName.d.mts +1 -1
  38. package/dist/backend/core/handlers/handleRouteByName.d.ts +1 -1
  39. package/dist/backend/core/handlers/handleRouteByName.js +13482 -7722
  40. package/dist/backend/core/handlers/handleRouteByName.mjs +3 -3
  41. package/dist/backend/core/handlers/index.d.mts +2 -2
  42. package/dist/backend/core/handlers/index.d.ts +2 -2
  43. package/dist/backend/core/handlers/index.js +13482 -7722
  44. package/dist/backend/core/handlers/index.mjs +4 -4
  45. package/dist/backend/core/handlers/resolveIdentity.d.mts +1 -1
  46. package/dist/backend/core/handlers/resolveIdentity.d.ts +1 -1
  47. package/dist/backend/core/index.d.mts +2 -2
  48. package/dist/backend/core/index.d.ts +2 -2
  49. package/dist/backend/core/index.js +13482 -7722
  50. package/dist/backend/core/index.mjs +4 -4
  51. package/dist/backend/core/routes/index.d.mts +2 -2
  52. package/dist/backend/core/routes/index.d.ts +2 -2
  53. package/dist/backend/core/routes/index.js +704 -41
  54. package/dist/backend/core/routes/index.mjs +1 -1
  55. package/dist/backend/core/routes/routeBuilder.d.mts +2 -2
  56. package/dist/backend/core/routes/routeBuilder.d.ts +2 -2
  57. package/dist/backend/core/routes/routeConfigs.d.mts +2 -2
  58. package/dist/backend/core/routes/routeConfigs.d.ts +2 -2
  59. package/dist/backend/core/routes/routeConfigs.js +704 -41
  60. package/dist/backend/core/routes/routeConfigs.mjs +1 -1
  61. package/dist/backend/core/types/authTypes.d.mts +1 -1
  62. package/dist/backend/core/types/authTypes.d.ts +1 -1
  63. package/dist/backend/core/types/handlerTypes.d.mts +2 -2
  64. package/dist/backend/core/types/handlerTypes.d.ts +2 -2
  65. package/dist/backend/core/types/index.d.mts +2 -2
  66. package/dist/backend/core/types/index.d.ts +2 -2
  67. package/dist/backend/core/types/routeTypes.d.mts +2 -2
  68. package/dist/backend/core/types/routeTypes.d.ts +2 -2
  69. package/dist/backend/index.d.mts +4 -4
  70. package/dist/backend/index.d.ts +4 -4
  71. package/dist/backend/index.js +13482 -7722
  72. package/dist/backend/index.mjs +4 -4
  73. package/dist/backend/{routeTypes-DmFnGvb2.d.mts → routeTypes-Bb3L3YJy.d.mts} +14646 -7926
  74. package/dist/backend/{routeTypes-ChCnBnee.d.ts → routeTypes-BhZ9UovL.d.ts} +14646 -7926
  75. package/dist/better-auth/{chunk-JBU3OM2O.mjs → chunk-4VW7A2HS.mjs} +13166 -8069
  76. package/dist/better-auth/{chunk-ZQA6B5RX.mjs → chunk-B2PHHBLY.mjs} +704 -41
  77. package/dist/better-auth/{chunk-56VTK4JS.mjs → chunk-D3DYQ36C.mjs} +1 -1
  78. package/dist/better-auth/index.js +13888 -8128
  79. package/dist/better-auth/index.mjs +3 -3
  80. package/dist/better-auth/types.d.mts +20 -1
  81. package/dist/better-auth/types.d.ts +20 -1
  82. package/dist/better-auth/utils/createAutumnEndpoint.js +704 -41
  83. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  84. package/dist/better-auth/utils/handleBetterAuthRoute.js +13482 -7722
  85. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  86. package/dist/better-auth/utils/index.js +13888 -8128
  87. package/dist/better-auth/utils/index.mjs +3 -3
  88. package/dist/react/AutumnContext.d.mts +4 -3
  89. package/dist/react/AutumnContext.d.ts +4 -3
  90. package/dist/react/AutumnProvider.js +678 -497
  91. package/dist/react/AutumnProvider.mjs +2 -2
  92. package/dist/react/{chunk-3CXPC6AS.mjs → chunk-6KIRT7EK.mjs} +1 -1
  93. package/dist/react/{chunk-PVCGOFQF.mjs → chunk-AAPQJY55.mjs} +1 -1
  94. package/dist/react/{chunk-N2L457YE.mjs → chunk-DDMHYLY3.mjs} +1 -1
  95. package/dist/react/{chunk-X7BHGQHX.mjs → chunk-ERN74FDW.mjs} +1 -1
  96. package/dist/react/{chunk-P23GII4V.mjs → chunk-FU6VEECB.mjs} +428 -235
  97. package/dist/react/{chunk-C4DMB2FQ.mjs → chunk-JH5BXBEU.mjs} +1 -1
  98. package/dist/react/{chunk-4TB3RHNC.mjs → chunk-M3L6EE7I.mjs} +1 -1
  99. package/dist/react/{chunk-Q3SFYOOM.mjs → chunk-VJDFB54U.mjs} +2 -2
  100. package/dist/react/{chunk-ZLGDHFMS.mjs → chunk-YZ23DM7M.mjs} +1 -1
  101. package/dist/react/client/AutumnClient.d.mts +4 -3
  102. package/dist/react/client/AutumnClient.d.ts +4 -3
  103. package/dist/react/client/IAutumnClient.d.mts +4 -471
  104. package/dist/react/client/IAutumnClient.d.ts +4 -471
  105. package/dist/react/client/index.d.mts +4 -3
  106. package/dist/react/client/index.d.ts +4 -3
  107. package/dist/react/{customer-B9DcViyn.d.mts → customer-Djhe48ql.d.ts} +24 -5
  108. package/dist/react/{customer-DbS31iZc.d.ts → customer-IVcJjz9u.d.mts} +24 -5
  109. package/dist/react/hooks/index.d.mts +4 -3
  110. package/dist/react/hooks/index.d.ts +4 -3
  111. package/dist/react/hooks/index.js +292 -193
  112. package/dist/react/hooks/index.mjs +8 -8
  113. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  114. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  115. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  116. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  117. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  118. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  119. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  120. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  121. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  122. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  123. package/dist/react/hooks/internal/useCustomerActions.d.mts +4 -3
  124. package/dist/react/hooks/internal/useCustomerActions.d.ts +4 -3
  125. package/dist/react/hooks/internal/useCustomerActions.js +1 -1
  126. package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
  127. package/dist/react/hooks/useAggregateEvents.d.mts +17 -17
  128. package/dist/react/hooks/useAggregateEvents.d.ts +17 -17
  129. package/dist/react/hooks/useAggregateEvents.js +292 -193
  130. package/dist/react/hooks/useAggregateEvents.mjs +2 -2
  131. package/dist/react/hooks/useCustomer.d.mts +3 -3
  132. package/dist/react/hooks/useCustomer.d.ts +3 -3
  133. package/dist/react/hooks/useCustomer.js +292 -193
  134. package/dist/react/hooks/useCustomer.mjs +3 -3
  135. package/dist/react/hooks/useEntity.d.mts +2 -2
  136. package/dist/react/hooks/useEntity.d.ts +2 -2
  137. package/dist/react/hooks/useEntity.js +292 -193
  138. package/dist/react/hooks/useEntity.mjs +2 -2
  139. package/dist/react/hooks/useListEvents.d.mts +17 -17
  140. package/dist/react/hooks/useListEvents.d.ts +17 -17
  141. package/dist/react/hooks/useListEvents.js +292 -193
  142. package/dist/react/hooks/useListEvents.mjs +2 -2
  143. package/dist/react/hooks/useListPlans.d.mts +5 -4
  144. package/dist/react/hooks/useListPlans.d.ts +5 -4
  145. package/dist/react/hooks/useListPlans.js +292 -193
  146. package/dist/react/hooks/useListPlans.mjs +2 -2
  147. package/dist/react/hooks/useReferrals.d.mts +2 -2
  148. package/dist/react/hooks/useReferrals.d.ts +2 -2
  149. package/dist/react/hooks/useReferrals.js +292 -193
  150. package/dist/react/hooks/useReferrals.mjs +2 -2
  151. package/dist/react/index.d.mts +4 -3
  152. package/dist/react/index.d.ts +4 -3
  153. package/dist/react/index.js +1586 -1393
  154. package/dist/react/index.mjs +9 -9
  155. package/dist/react/list-plans-op-ByqRxdNR.d.mts +1224 -0
  156. package/dist/react/list-plans-op-D-K2LRZV.d.ts +1224 -0
  157. package/dist/react/{params-B8-s4Q1n.d.ts → params-CFhvUVCf.d.ts} +1605 -199
  158. package/dist/react/{params-BquS51Ut.d.mts → params-D3ra6In7.d.mts} +1605 -199
  159. package/dist/react/plan-DOxbvjQY.d.mts +1496 -0
  160. package/dist/react/plan-DOxbvjQY.d.ts +1496 -0
  161. package/dist/sdk/index.d.mts +19588 -11175
  162. package/dist/sdk/index.d.ts +19588 -11175
  163. package/dist/sdk/index.js +19103 -11652
  164. package/dist/sdk/index.mjs +18149 -11528
  165. package/package.json +1 -1
  166. package/dist/react/plan-BKltGb1S.d.mts +0 -743
  167. package/dist/react/plan-BKltGb1S.d.ts +0 -743
@@ -0,0 +1,1224 @@
1
+ import { O as OpenEnum } from './plan-DOxbvjQY.mjs';
2
+
3
+ /**
4
+ * Billing interval (e.g. 'month', 'year').
5
+ */
6
+ declare const ListPlansPriceInterval: {
7
+ readonly OneOff: "one_off";
8
+ readonly Week: "week";
9
+ readonly Month: "month";
10
+ readonly Quarter: "quarter";
11
+ readonly SemiAnnual: "semi_annual";
12
+ readonly Year: "year";
13
+ };
14
+ /**
15
+ * Billing interval (e.g. 'month', 'year').
16
+ */
17
+ type ListPlansPriceInterval = OpenEnum<typeof ListPlansPriceInterval>;
18
+ /**
19
+ * Display text for showing this price in pricing pages.
20
+ */
21
+ type ListPlansPriceDisplay = {
22
+ /**
23
+ * Main display text (e.g. '$10' or '100 messages').
24
+ */
25
+ primaryText: string;
26
+ /**
27
+ * Secondary display text (e.g. 'per month' or 'then $0.5 per 100').
28
+ */
29
+ secondaryText?: string | undefined;
30
+ };
31
+ type ListPlansPrice = {
32
+ /**
33
+ * Base price amount for the plan.
34
+ */
35
+ amount: number;
36
+ /**
37
+ * Billing interval (e.g. 'month', 'year').
38
+ */
39
+ interval: ListPlansPriceInterval;
40
+ /**
41
+ * Number of intervals per billing cycle. Defaults to 1.
42
+ */
43
+ intervalCount?: number | undefined;
44
+ /**
45
+ * Display text for showing this price in pricing pages.
46
+ */
47
+ display?: ListPlansPriceDisplay | undefined;
48
+ };
49
+ /**
50
+ * The type of the feature
51
+ */
52
+ declare const ListPlansType: {
53
+ readonly Static: "static";
54
+ readonly Boolean: "boolean";
55
+ readonly SingleUse: "single_use";
56
+ readonly ContinuousUse: "continuous_use";
57
+ readonly CreditSystem: "credit_system";
58
+ readonly AiCreditSystem: "ai_credit_system";
59
+ };
60
+ /**
61
+ * The type of the feature
62
+ */
63
+ type ListPlansType = OpenEnum<typeof ListPlansType>;
64
+ type ListPlansFeatureDisplay = {
65
+ /**
66
+ * The singular display name for the feature.
67
+ */
68
+ singular: string;
69
+ /**
70
+ * The plural display name for the feature.
71
+ */
72
+ plural: string;
73
+ };
74
+ type ListPlansCreditSchema = {
75
+ /**
76
+ * The ID of the metered feature (should be a single_use feature).
77
+ */
78
+ meteredFeatureId: string;
79
+ /**
80
+ * The credit cost of the metered feature.
81
+ */
82
+ creditCost: number;
83
+ };
84
+ /**
85
+ * The full feature object if expanded.
86
+ */
87
+ type ListPlansFeature = {
88
+ /**
89
+ * The ID of the feature, used to refer to it in other API calls like /track or /check.
90
+ */
91
+ id: string;
92
+ /**
93
+ * The name of the feature.
94
+ */
95
+ name?: string | null | undefined;
96
+ /**
97
+ * The type of the feature
98
+ */
99
+ type: ListPlansType;
100
+ /**
101
+ * Singular and plural display names for the feature.
102
+ */
103
+ display?: ListPlansFeatureDisplay | null | undefined;
104
+ /**
105
+ * Credit cost schema for credit system features.
106
+ */
107
+ creditSchema?: Array<ListPlansCreditSchema> | null | undefined;
108
+ /**
109
+ * Whether or not the feature is archived.
110
+ */
111
+ archived?: boolean | null | undefined;
112
+ };
113
+ /**
114
+ * The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
115
+ */
116
+ declare const ListPlansResetItemInterval: {
117
+ readonly OneOff: "one_off";
118
+ readonly Minute: "minute";
119
+ readonly Hour: "hour";
120
+ readonly Day: "day";
121
+ readonly Week: "week";
122
+ readonly Month: "month";
123
+ readonly Quarter: "quarter";
124
+ readonly SemiAnnual: "semi_annual";
125
+ readonly Year: "year";
126
+ };
127
+ /**
128
+ * The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
129
+ */
130
+ type ListPlansResetItemInterval = OpenEnum<typeof ListPlansResetItemInterval>;
131
+ type ListPlansItemReset = {
132
+ /**
133
+ * The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
134
+ */
135
+ interval: ListPlansResetItemInterval;
136
+ /**
137
+ * Number of intervals between resets. Defaults to 1.
138
+ */
139
+ intervalCount?: number | undefined;
140
+ };
141
+ type ListPlansItemTier = {
142
+ to: number | string;
143
+ amount: number;
144
+ flatAmount?: number | undefined;
145
+ };
146
+ declare const ListPlansItemTierBehavior: {
147
+ readonly Graduated: "graduated";
148
+ readonly Volume: "volume";
149
+ };
150
+ type ListPlansItemTierBehavior = OpenEnum<typeof ListPlansItemTierBehavior>;
151
+ /**
152
+ * Billing interval for this price. For consumable features, should match reset.interval.
153
+ */
154
+ declare const ListPlansPriceItemInterval: {
155
+ readonly OneOff: "one_off";
156
+ readonly Week: "week";
157
+ readonly Month: "month";
158
+ readonly Quarter: "quarter";
159
+ readonly SemiAnnual: "semi_annual";
160
+ readonly Year: "year";
161
+ };
162
+ /**
163
+ * Billing interval for this price. For consumable features, should match reset.interval.
164
+ */
165
+ type ListPlansPriceItemInterval = OpenEnum<typeof ListPlansPriceItemInterval>;
166
+ /**
167
+ * 'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage.
168
+ */
169
+ declare const ListPlansItemBillingMethod: {
170
+ readonly Prepaid: "prepaid";
171
+ readonly UsageBased: "usage_based";
172
+ };
173
+ /**
174
+ * 'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage.
175
+ */
176
+ type ListPlansItemBillingMethod = OpenEnum<typeof ListPlansItemBillingMethod>;
177
+ type ListPlansItemPrice = {
178
+ /**
179
+ * Price per billing_units after included usage is consumed. Mutually exclusive with tiers.
180
+ */
181
+ amount?: number | undefined;
182
+ /**
183
+ * Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
184
+ */
185
+ tiers?: Array<ListPlansItemTier> | undefined;
186
+ tierBehavior?: ListPlansItemTierBehavior | undefined;
187
+ /**
188
+ * Billing interval for this price. For consumable features, should match reset.interval.
189
+ */
190
+ interval: ListPlansPriceItemInterval;
191
+ /**
192
+ * Number of intervals per billing cycle. Defaults to 1.
193
+ */
194
+ intervalCount?: number | undefined;
195
+ /**
196
+ * Number of units per price increment. Usage is rounded UP to the nearest billing_units when billed (e.g. billing_units=100 means 101 usage rounds to 200).
197
+ */
198
+ billingUnits: number;
199
+ /**
200
+ * 'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage.
201
+ */
202
+ billingMethod: ListPlansItemBillingMethod;
203
+ /**
204
+ * Maximum units a customer can purchase beyond included. E.g. if included=100 and max_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
205
+ */
206
+ maxPurchase: number | null;
207
+ };
208
+ /**
209
+ * Display text for showing this item in pricing pages.
210
+ */
211
+ type ListPlansItemDisplay = {
212
+ /**
213
+ * Main display text (e.g. '$10' or '100 messages').
214
+ */
215
+ primaryText: string;
216
+ /**
217
+ * Secondary display text (e.g. 'per month' or 'then $0.5 per 100').
218
+ */
219
+ secondaryText?: string | undefined;
220
+ };
221
+ /**
222
+ * When rolled over units expire.
223
+ */
224
+ declare const ListPlansItemExpiryDurationType: {
225
+ readonly Month: "month";
226
+ readonly Forever: "forever";
227
+ };
228
+ /**
229
+ * When rolled over units expire.
230
+ */
231
+ type ListPlansItemExpiryDurationType = OpenEnum<typeof ListPlansItemExpiryDurationType>;
232
+ /**
233
+ * Rollover configuration for unused units. If set, unused included units roll over to the next period.
234
+ */
235
+ type ListPlansItemRollover = {
236
+ /**
237
+ * Maximum rollover units. Null for unlimited rollover.
238
+ */
239
+ max: number | null;
240
+ /**
241
+ * Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
242
+ */
243
+ maxPercentage?: number | null | undefined;
244
+ /**
245
+ * When rolled over units expire.
246
+ */
247
+ expiryDurationType: ListPlansItemExpiryDurationType;
248
+ /**
249
+ * Number of periods before expiry.
250
+ */
251
+ expiryDurationLength?: number | undefined;
252
+ };
253
+ type ListPlansItem = {
254
+ /**
255
+ * The ID of the feature this item configures.
256
+ */
257
+ featureId: string;
258
+ /**
259
+ * The full feature object if expanded.
260
+ */
261
+ feature?: ListPlansFeature | undefined;
262
+ /**
263
+ * Number of free units included. For consumable features, balance resets to this number each interval.
264
+ */
265
+ included: number;
266
+ /**
267
+ * Whether the customer has unlimited access to this feature.
268
+ */
269
+ unlimited: boolean;
270
+ /**
271
+ * Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
272
+ */
273
+ reset: ListPlansItemReset | null;
274
+ /**
275
+ * Pricing configuration for usage beyond included units. Null if feature is entirely free.
276
+ */
277
+ price: ListPlansItemPrice | null;
278
+ /**
279
+ * Display text for showing this item in pricing pages.
280
+ */
281
+ display?: ListPlansItemDisplay | undefined;
282
+ /**
283
+ * Rollover configuration for unused units. If set, unused included units roll over to the next period.
284
+ */
285
+ rollover?: ListPlansItemRollover | undefined;
286
+ };
287
+ /**
288
+ * Unit of time for the trial duration ('day', 'month', 'year').
289
+ */
290
+ declare const ListPlansDurationType: {
291
+ readonly Day: "day";
292
+ readonly Month: "month";
293
+ readonly Year: "year";
294
+ };
295
+ /**
296
+ * Unit of time for the trial duration ('day', 'month', 'year').
297
+ */
298
+ type ListPlansDurationType = OpenEnum<typeof ListPlansDurationType>;
299
+ declare const ListPlansOnEnd: {
300
+ readonly Bill: "bill";
301
+ readonly Revert: "revert";
302
+ };
303
+ type ListPlansOnEnd = OpenEnum<typeof ListPlansOnEnd>;
304
+ /**
305
+ * Free trial configuration. If set, new customers can try this plan before being charged.
306
+ */
307
+ type ListPlansFreeTrial = {
308
+ /**
309
+ * Number of duration_type periods the trial lasts.
310
+ */
311
+ durationLength: number;
312
+ /**
313
+ * Unit of time for the trial duration ('day', 'month', 'year').
314
+ */
315
+ durationType: ListPlansDurationType;
316
+ /**
317
+ * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
318
+ */
319
+ cardRequired: boolean;
320
+ /**
321
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
322
+ */
323
+ onEnd?: ListPlansOnEnd | null | undefined;
324
+ };
325
+ /**
326
+ * Environment this plan belongs to ('sandbox' or 'live').
327
+ */
328
+ declare const ListPlansEnv: {
329
+ readonly Sandbox: "sandbox";
330
+ readonly Live: "live";
331
+ };
332
+ /**
333
+ * Environment this plan belongs to ('sandbox' or 'live').
334
+ */
335
+ type ListPlansEnv = OpenEnum<typeof ListPlansEnv>;
336
+ /**
337
+ * Billing interval (e.g. 'month', 'year').
338
+ */
339
+ declare const ListPlansPriceVariantDetailsInterval: {
340
+ readonly OneOff: "one_off";
341
+ readonly Week: "week";
342
+ readonly Month: "month";
343
+ readonly Quarter: "quarter";
344
+ readonly SemiAnnual: "semi_annual";
345
+ readonly Year: "year";
346
+ };
347
+ /**
348
+ * Billing interval (e.g. 'month', 'year').
349
+ */
350
+ type ListPlansPriceVariantDetailsInterval = OpenEnum<typeof ListPlansPriceVariantDetailsInterval>;
351
+ /**
352
+ * Base price configuration for a plan.
353
+ */
354
+ type ListPlansBasePrice = {
355
+ /**
356
+ * Base price amount for the plan.
357
+ */
358
+ amount: number;
359
+ /**
360
+ * Billing interval (e.g. 'month', 'year').
361
+ */
362
+ interval: ListPlansPriceVariantDetailsInterval;
363
+ /**
364
+ * Number of intervals per billing cycle. Defaults to 1.
365
+ */
366
+ intervalCount?: number | undefined;
367
+ };
368
+ /**
369
+ * Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
370
+ */
371
+ declare const ListPlansAddItemResetInterval: {
372
+ readonly OneOff: "one_off";
373
+ readonly Minute: "minute";
374
+ readonly Hour: "hour";
375
+ readonly Day: "day";
376
+ readonly Week: "week";
377
+ readonly Month: "month";
378
+ readonly Quarter: "quarter";
379
+ readonly SemiAnnual: "semi_annual";
380
+ readonly Year: "year";
381
+ };
382
+ /**
383
+ * Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
384
+ */
385
+ type ListPlansAddItemResetInterval = OpenEnum<typeof ListPlansAddItemResetInterval>;
386
+ /**
387
+ * Reset configuration for consumable features. Omit for non-consumable features like seats.
388
+ */
389
+ type ListPlansVariantDetailsReset = {
390
+ /**
391
+ * Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
392
+ */
393
+ interval: ListPlansAddItemResetInterval;
394
+ /**
395
+ * Number of intervals between resets. Defaults to 1.
396
+ */
397
+ intervalCount?: number | undefined;
398
+ };
399
+ type ListPlansVariantDetailsTier = {
400
+ to?: any | undefined;
401
+ amount: number;
402
+ flatAmount?: number | undefined;
403
+ };
404
+ declare const ListPlansVariantDetailsTierBehavior: {
405
+ readonly Graduated: "graduated";
406
+ readonly Volume: "volume";
407
+ };
408
+ type ListPlansVariantDetailsTierBehavior = OpenEnum<typeof ListPlansVariantDetailsTierBehavior>;
409
+ /**
410
+ * Billing interval. For consumable features, should match reset.interval.
411
+ */
412
+ declare const ListPlansAddItemPriceInterval: {
413
+ readonly OneOff: "one_off";
414
+ readonly Week: "week";
415
+ readonly Month: "month";
416
+ readonly Quarter: "quarter";
417
+ readonly SemiAnnual: "semi_annual";
418
+ readonly Year: "year";
419
+ };
420
+ /**
421
+ * Billing interval. For consumable features, should match reset.interval.
422
+ */
423
+ type ListPlansAddItemPriceInterval = OpenEnum<typeof ListPlansAddItemPriceInterval>;
424
+ /**
425
+ * 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
426
+ */
427
+ declare const ListPlansAddItemBillingMethod: {
428
+ readonly Prepaid: "prepaid";
429
+ readonly UsageBased: "usage_based";
430
+ };
431
+ /**
432
+ * 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
433
+ */
434
+ type ListPlansAddItemBillingMethod = OpenEnum<typeof ListPlansAddItemBillingMethod>;
435
+ /**
436
+ * Pricing for usage beyond included units. Omit for free features.
437
+ */
438
+ type ListPlansVariantDetailsPrice = {
439
+ /**
440
+ * Price per billing_units after included usage. Either 'amount' or 'tiers' is required.
441
+ */
442
+ amount?: number | undefined;
443
+ /**
444
+ * Tiered pricing. Either 'amount' or 'tiers' is required.
445
+ */
446
+ tiers?: Array<ListPlansVariantDetailsTier> | undefined;
447
+ tierBehavior?: ListPlansVariantDetailsTierBehavior | undefined;
448
+ /**
449
+ * Billing interval. For consumable features, should match reset.interval.
450
+ */
451
+ interval: ListPlansAddItemPriceInterval;
452
+ /**
453
+ * Number of intervals per billing cycle. Defaults to 1.
454
+ */
455
+ intervalCount: number;
456
+ /**
457
+ * Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200).
458
+ */
459
+ billingUnits: number;
460
+ /**
461
+ * 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
462
+ */
463
+ billingMethod: ListPlansAddItemBillingMethod;
464
+ /**
465
+ * Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit.
466
+ */
467
+ maxPurchase?: number | null | undefined;
468
+ };
469
+ /**
470
+ * Billing behavior when quantity increases mid-cycle.
471
+ */
472
+ declare const ListPlansOnIncrease: {
473
+ readonly BillImmediately: "bill_immediately";
474
+ readonly ProrateImmediately: "prorate_immediately";
475
+ readonly ProrateNextCycle: "prorate_next_cycle";
476
+ readonly BillNextCycle: "bill_next_cycle";
477
+ };
478
+ /**
479
+ * Billing behavior when quantity increases mid-cycle.
480
+ */
481
+ type ListPlansOnIncrease = OpenEnum<typeof ListPlansOnIncrease>;
482
+ /**
483
+ * Credit behavior when quantity decreases mid-cycle.
484
+ */
485
+ declare const ListPlansOnDecrease: {
486
+ readonly Prorate: "prorate";
487
+ readonly ProrateImmediately: "prorate_immediately";
488
+ readonly ProrateNextCycle: "prorate_next_cycle";
489
+ readonly None: "none";
490
+ readonly NoProrations: "no_prorations";
491
+ };
492
+ /**
493
+ * Credit behavior when quantity decreases mid-cycle.
494
+ */
495
+ type ListPlansOnDecrease = OpenEnum<typeof ListPlansOnDecrease>;
496
+ /**
497
+ * Proration settings for prepaid features. Controls mid-cycle quantity change billing.
498
+ */
499
+ type ListPlansProration = {
500
+ /**
501
+ * Billing behavior when quantity increases mid-cycle.
502
+ */
503
+ onIncrease: ListPlansOnIncrease;
504
+ /**
505
+ * Credit behavior when quantity decreases mid-cycle.
506
+ */
507
+ onDecrease: ListPlansOnDecrease;
508
+ };
509
+ /**
510
+ * When rolled over units expire.
511
+ */
512
+ declare const ListPlansVariantDetailsExpiryDurationType: {
513
+ readonly Month: "month";
514
+ readonly Forever: "forever";
515
+ };
516
+ /**
517
+ * When rolled over units expire.
518
+ */
519
+ type ListPlansVariantDetailsExpiryDurationType = OpenEnum<typeof ListPlansVariantDetailsExpiryDurationType>;
520
+ /**
521
+ * Rollover config for unused units. If set, unused included units carry over.
522
+ */
523
+ type ListPlansVariantDetailsRollover = {
524
+ /**
525
+ * Max rollover units. Omit for unlimited rollover.
526
+ */
527
+ max?: number | undefined;
528
+ /**
529
+ * Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
530
+ */
531
+ maxPercentage?: number | undefined;
532
+ /**
533
+ * When rolled over units expire.
534
+ */
535
+ expiryDurationType: ListPlansVariantDetailsExpiryDurationType;
536
+ /**
537
+ * Number of periods before expiry.
538
+ */
539
+ expiryDurationLength?: number | undefined;
540
+ };
541
+ /**
542
+ * Configuration for a feature item in a plan, including usage limits, pricing, and rollover settings.
543
+ */
544
+ type ListPlansPlanItem = {
545
+ /**
546
+ * The ID of the feature to configure.
547
+ */
548
+ featureId: string;
549
+ /**
550
+ * Number of free units included. Balance resets to this each interval for consumable features.
551
+ */
552
+ included?: number | undefined;
553
+ /**
554
+ * If true, customer has unlimited access to this feature.
555
+ */
556
+ unlimited?: boolean | undefined;
557
+ /**
558
+ * Reset configuration for consumable features. Omit for non-consumable features like seats.
559
+ */
560
+ reset?: ListPlansVariantDetailsReset | undefined;
561
+ /**
562
+ * Pricing for usage beyond included units. Omit for free features.
563
+ */
564
+ price?: ListPlansVariantDetailsPrice | undefined;
565
+ /**
566
+ * Proration settings for prepaid features. Controls mid-cycle quantity change billing.
567
+ */
568
+ proration?: ListPlansProration | undefined;
569
+ /**
570
+ * Rollover config for unused units. If set, unused included units carry over.
571
+ */
572
+ rollover?: ListPlansVariantDetailsRollover | undefined;
573
+ };
574
+ /**
575
+ * Match items with this billing method (prepaid or usage_based).
576
+ */
577
+ declare const ListPlansRemoveItemBillingMethod: {
578
+ readonly Prepaid: "prepaid";
579
+ readonly UsageBased: "usage_based";
580
+ };
581
+ /**
582
+ * Match items with this billing method (prepaid or usage_based).
583
+ */
584
+ type ListPlansRemoveItemBillingMethod = OpenEnum<typeof ListPlansRemoveItemBillingMethod>;
585
+ declare const ListPlansIntervalRemoveItemEnum2: {
586
+ readonly OneOff: "one_off";
587
+ readonly Minute: "minute";
588
+ readonly Hour: "hour";
589
+ readonly Day: "day";
590
+ readonly Week: "week";
591
+ readonly Month: "month";
592
+ readonly Quarter: "quarter";
593
+ readonly SemiAnnual: "semi_annual";
594
+ readonly Year: "year";
595
+ };
596
+ type ListPlansIntervalRemoveItemEnum2 = OpenEnum<typeof ListPlansIntervalRemoveItemEnum2>;
597
+ declare const ListPlansIntervalRemoveItemEnum1: {
598
+ readonly OneOff: "one_off";
599
+ readonly Week: "week";
600
+ readonly Month: "month";
601
+ readonly Quarter: "quarter";
602
+ readonly SemiAnnual: "semi_annual";
603
+ readonly Year: "year";
604
+ };
605
+ type ListPlansIntervalRemoveItemEnum1 = OpenEnum<typeof ListPlansIntervalRemoveItemEnum1>;
606
+ /**
607
+ * Filter for matching plan items. All provided fields must match (AND).
608
+ */
609
+ type ListPlansPlanItemFilter = {
610
+ /**
611
+ * Match items linked to this feature.
612
+ */
613
+ featureId?: string | undefined;
614
+ /**
615
+ * Match items with this billing method (prepaid or usage_based).
616
+ */
617
+ billingMethod?: ListPlansRemoveItemBillingMethod | undefined;
618
+ /**
619
+ * Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
620
+ */
621
+ interval?: ListPlansIntervalRemoveItemEnum1 | ListPlansIntervalRemoveItemEnum2 | undefined;
622
+ /**
623
+ * Match items with this interval_count. Disambiguates between items that share an interval but differ in count.
624
+ */
625
+ intervalCount?: number | undefined;
626
+ };
627
+ /**
628
+ * Unit of time for the trial ('day', 'month', 'year').
629
+ */
630
+ declare const ListPlansVariantDetailsDurationType: {
631
+ readonly Day: "day";
632
+ readonly Month: "month";
633
+ readonly Year: "year";
634
+ };
635
+ /**
636
+ * Unit of time for the trial ('day', 'month', 'year').
637
+ */
638
+ type ListPlansVariantDetailsDurationType = OpenEnum<typeof ListPlansVariantDetailsDurationType>;
639
+ /**
640
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
641
+ */
642
+ declare const ListPlansVariantDetailsOnEnd: {
643
+ readonly Bill: "bill";
644
+ readonly Revert: "revert";
645
+ };
646
+ /**
647
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
648
+ */
649
+ type ListPlansVariantDetailsOnEnd = OpenEnum<typeof ListPlansVariantDetailsOnEnd>;
650
+ /**
651
+ * Free trial configuration for a plan.
652
+ */
653
+ type ListPlansFreeTrialParams = {
654
+ /**
655
+ * Number of duration_type periods the trial lasts.
656
+ */
657
+ durationLength: number;
658
+ /**
659
+ * Unit of time for the trial ('day', 'month', 'year').
660
+ */
661
+ durationType: ListPlansVariantDetailsDurationType;
662
+ /**
663
+ * If true, payment method required to start trial. Customer is charged after trial ends.
664
+ */
665
+ cardRequired: boolean;
666
+ /**
667
+ * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
668
+ */
669
+ onEnd?: ListPlansVariantDetailsOnEnd | undefined;
670
+ };
671
+ /**
672
+ * The time interval for the purchase limit window.
673
+ */
674
+ declare const ListPlansVariantDetailsPurchaseLimitInterval: {
675
+ readonly Hour: "hour";
676
+ readonly Day: "day";
677
+ readonly Week: "week";
678
+ readonly Month: "month";
679
+ };
680
+ /**
681
+ * The time interval for the purchase limit window.
682
+ */
683
+ type ListPlansVariantDetailsPurchaseLimitInterval = OpenEnum<typeof ListPlansVariantDetailsPurchaseLimitInterval>;
684
+ /**
685
+ * Optional rate limit to cap how often auto top-ups occur.
686
+ */
687
+ type ListPlansVariantDetailsPurchaseLimit = {
688
+ /**
689
+ * The time interval for the purchase limit window.
690
+ */
691
+ interval: ListPlansVariantDetailsPurchaseLimitInterval;
692
+ /**
693
+ * Number of intervals in the purchase limit window.
694
+ */
695
+ intervalCount: number;
696
+ /**
697
+ * Maximum number of auto top-ups allowed within the interval.
698
+ */
699
+ limit: number;
700
+ };
701
+ type ListPlansVariantDetailsAutoTopup = {
702
+ /**
703
+ * The ID of the feature (credit balance) to auto top-up.
704
+ */
705
+ featureId: string;
706
+ /**
707
+ * Whether auto top-up is enabled.
708
+ */
709
+ enabled: boolean;
710
+ /**
711
+ * When the balance drops below this threshold, an auto top-up will be purchased.
712
+ */
713
+ threshold: number;
714
+ /**
715
+ * Amount of credits to add per auto top-up.
716
+ */
717
+ quantity: number;
718
+ /**
719
+ * Optional rate limit to cap how often auto top-ups occur.
720
+ */
721
+ purchaseLimit?: ListPlansVariantDetailsPurchaseLimit | undefined;
722
+ /**
723
+ * When true, auto top-up creates a send_invoice invoice instead of auto-charging.
724
+ */
725
+ invoiceMode?: boolean | undefined;
726
+ };
727
+ /**
728
+ * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
729
+ */
730
+ declare const ListPlansVariantDetailsLimitType: {
731
+ readonly Absolute: "absolute";
732
+ readonly UsagePercentage: "usage_percentage";
733
+ };
734
+ /**
735
+ * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
736
+ */
737
+ type ListPlansVariantDetailsLimitType = OpenEnum<typeof ListPlansVariantDetailsLimitType>;
738
+ type ListPlansVariantDetailsSpendLimit = {
739
+ /**
740
+ * Optional feature ID this spend limit applies to.
741
+ */
742
+ featureId?: string | undefined;
743
+ /**
744
+ * Whether the overage spend limit is enabled.
745
+ */
746
+ enabled: boolean;
747
+ /**
748
+ * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
749
+ */
750
+ limitType?: ListPlansVariantDetailsLimitType | undefined;
751
+ /**
752
+ * Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage.
753
+ */
754
+ overageLimit?: number | undefined;
755
+ };
756
+ /**
757
+ * Interval for the cap, aligned to the customer's billing cycle.
758
+ */
759
+ declare const ListPlansVariantDetailsUsageLimitInterval: {
760
+ readonly Day: "day";
761
+ readonly Week: "week";
762
+ readonly Month: "month";
763
+ readonly Year: "year";
764
+ };
765
+ /**
766
+ * Interval for the cap, aligned to the customer's billing cycle.
767
+ */
768
+ type ListPlansVariantDetailsUsageLimitInterval = OpenEnum<typeof ListPlansVariantDetailsUsageLimitInterval>;
769
+ type ListPlansVariantDetailsUsageLimit = {
770
+ /**
771
+ * The feature this usage limit applies to.
772
+ */
773
+ featureId: string;
774
+ /**
775
+ * Whether this usage limit is enabled.
776
+ */
777
+ enabled: boolean;
778
+ /**
779
+ * Maximum units allowed per interval.
780
+ */
781
+ limit: number;
782
+ /**
783
+ * Interval for the cap, aligned to the customer's billing cycle.
784
+ */
785
+ interval: ListPlansVariantDetailsUsageLimitInterval;
786
+ };
787
+ /**
788
+ * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
789
+ */
790
+ declare const ListPlansVariantDetailsThresholdType: {
791
+ readonly Usage: "usage";
792
+ readonly UsagePercentage: "usage_percentage";
793
+ readonly Remaining: "remaining";
794
+ readonly RemainingPercentage: "remaining_percentage";
795
+ };
796
+ /**
797
+ * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
798
+ */
799
+ type ListPlansVariantDetailsThresholdType = OpenEnum<typeof ListPlansVariantDetailsThresholdType>;
800
+ type ListPlansVariantDetailsUsageAlert = {
801
+ /**
802
+ * The feature ID this alert applies to.
803
+ */
804
+ featureId?: string | undefined;
805
+ /**
806
+ * Whether this usage alert is enabled.
807
+ */
808
+ enabled: boolean;
809
+ /**
810
+ * The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage_percentage or remaining_percentage, this is a percentage (0-100).
811
+ */
812
+ threshold: number;
813
+ /**
814
+ * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
815
+ */
816
+ thresholdType: ListPlansVariantDetailsThresholdType;
817
+ /**
818
+ * Optional user-defined label to distinguish multiple alerts on the same feature.
819
+ */
820
+ name?: string | undefined;
821
+ };
822
+ type ListPlansVariantDetailsOverageAllowed = {
823
+ /**
824
+ * The feature ID this overage allowed control applies to.
825
+ */
826
+ featureId: string;
827
+ /**
828
+ * Whether overage is allowed for this feature.
829
+ */
830
+ enabled: boolean;
831
+ };
832
+ /**
833
+ * Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
834
+ */
835
+ type ListPlansVariantDetailsBillingControls = {
836
+ /**
837
+ * List of auto top-up configurations per feature.
838
+ */
839
+ autoTopups?: Array<ListPlansVariantDetailsAutoTopup> | undefined;
840
+ /**
841
+ * List of overage spend limits per feature (caps overage spend).
842
+ */
843
+ spendLimits?: Array<ListPlansVariantDetailsSpendLimit> | undefined;
844
+ /**
845
+ * List of hard usage caps per feature (max units per interval).
846
+ */
847
+ usageLimits?: Array<ListPlansVariantDetailsUsageLimit> | undefined;
848
+ /**
849
+ * List of usage alert configurations per feature.
850
+ */
851
+ usageAlerts?: Array<ListPlansVariantDetailsUsageAlert> | undefined;
852
+ /**
853
+ * List of overage allowed controls per feature. When enabled, usage can exceed balance.
854
+ */
855
+ overageAllowed?: Array<ListPlansVariantDetailsOverageAllowed> | undefined;
856
+ };
857
+ /**
858
+ * The customization that transforms the base plan into this variant.
859
+ */
860
+ type ListPlansCustomize = {
861
+ /**
862
+ * Override the base price of the plan. Pass null to remove the base price.
863
+ */
864
+ price?: ListPlansBasePrice | null | undefined;
865
+ /**
866
+ * Items to add to the plan.
867
+ */
868
+ addItems?: Array<ListPlansPlanItem> | undefined;
869
+ /**
870
+ * Filters selecting items to remove from the plan.
871
+ */
872
+ removeItems?: Array<ListPlansPlanItemFilter> | undefined;
873
+ /**
874
+ * Override the plan's default free trial. Pass an object to set a custom trial, or null to remove the trial entirely.
875
+ */
876
+ freeTrial?: ListPlansFreeTrialParams | null | undefined;
877
+ /**
878
+ * Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
879
+ */
880
+ billingControls?: ListPlansVariantDetailsBillingControls | undefined;
881
+ };
882
+ /**
883
+ * Details about how this variant relates to its latest base plan.
884
+ */
885
+ type ListPlansVariantDetails = {
886
+ /**
887
+ * The ID of the base plan this variant was derived from.
888
+ */
889
+ basePlanId: string;
890
+ /**
891
+ * The customization that transforms the base plan into this variant.
892
+ */
893
+ customize?: ListPlansCustomize | undefined;
894
+ };
895
+ /**
896
+ * Miscellaneous plan-level configuration flags.
897
+ */
898
+ type ListPlansConfig = {
899
+ /**
900
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
901
+ */
902
+ ignorePastDue: boolean;
903
+ };
904
+ /**
905
+ * The time interval for the purchase limit window.
906
+ */
907
+ declare const ListPlansPurchaseLimitInterval: {
908
+ readonly Hour: "hour";
909
+ readonly Day: "day";
910
+ readonly Week: "week";
911
+ readonly Month: "month";
912
+ };
913
+ /**
914
+ * The time interval for the purchase limit window.
915
+ */
916
+ type ListPlansPurchaseLimitInterval = OpenEnum<typeof ListPlansPurchaseLimitInterval>;
917
+ /**
918
+ * Optional rate limit to cap how often auto top-ups occur.
919
+ */
920
+ type ListPlansPurchaseLimit = {
921
+ /**
922
+ * The time interval for the purchase limit window.
923
+ */
924
+ interval: ListPlansPurchaseLimitInterval;
925
+ /**
926
+ * Number of intervals in the purchase limit window.
927
+ */
928
+ intervalCount: number;
929
+ /**
930
+ * Maximum number of auto top-ups allowed within the interval.
931
+ */
932
+ limit: number;
933
+ };
934
+ type ListPlansAutoTopup = {
935
+ /**
936
+ * The ID of the feature (credit balance) to auto top-up.
937
+ */
938
+ featureId: string;
939
+ /**
940
+ * Whether auto top-up is enabled.
941
+ */
942
+ enabled: boolean;
943
+ /**
944
+ * When the balance drops below this threshold, an auto top-up will be purchased.
945
+ */
946
+ threshold: number;
947
+ /**
948
+ * Amount of credits to add per auto top-up.
949
+ */
950
+ quantity: number;
951
+ /**
952
+ * Optional rate limit to cap how often auto top-ups occur.
953
+ */
954
+ purchaseLimit?: ListPlansPurchaseLimit | undefined;
955
+ /**
956
+ * When true, auto top-up creates a send_invoice invoice instead of auto-charging.
957
+ */
958
+ invoiceMode?: boolean | undefined;
959
+ };
960
+ /**
961
+ * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
962
+ */
963
+ declare const ListPlansLimitType: {
964
+ readonly Absolute: "absolute";
965
+ readonly UsagePercentage: "usage_percentage";
966
+ };
967
+ /**
968
+ * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
969
+ */
970
+ type ListPlansLimitType = OpenEnum<typeof ListPlansLimitType>;
971
+ type ListPlansSpendLimit = {
972
+ /**
973
+ * Optional feature ID this spend limit applies to.
974
+ */
975
+ featureId?: string | undefined;
976
+ /**
977
+ * Whether the overage spend limit is enabled.
978
+ */
979
+ enabled: boolean;
980
+ /**
981
+ * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
982
+ */
983
+ limitType?: ListPlansLimitType | undefined;
984
+ /**
985
+ * Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage.
986
+ */
987
+ overageLimit?: number | undefined;
988
+ };
989
+ /**
990
+ * Interval for the cap, aligned to the customer's billing cycle.
991
+ */
992
+ declare const ListPlansUsageLimitInterval: {
993
+ readonly Day: "day";
994
+ readonly Week: "week";
995
+ readonly Month: "month";
996
+ readonly Year: "year";
997
+ };
998
+ /**
999
+ * Interval for the cap, aligned to the customer's billing cycle.
1000
+ */
1001
+ type ListPlansUsageLimitInterval = OpenEnum<typeof ListPlansUsageLimitInterval>;
1002
+ type ListPlansUsageLimit = {
1003
+ /**
1004
+ * The feature this usage limit applies to.
1005
+ */
1006
+ featureId: string;
1007
+ /**
1008
+ * Whether this usage limit is enabled.
1009
+ */
1010
+ enabled: boolean;
1011
+ /**
1012
+ * Maximum units allowed per interval.
1013
+ */
1014
+ limit: number;
1015
+ /**
1016
+ * Interval for the cap, aligned to the customer's billing cycle.
1017
+ */
1018
+ interval: ListPlansUsageLimitInterval;
1019
+ };
1020
+ /**
1021
+ * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
1022
+ */
1023
+ declare const ListPlansThresholdType: {
1024
+ readonly Usage: "usage";
1025
+ readonly UsagePercentage: "usage_percentage";
1026
+ readonly Remaining: "remaining";
1027
+ readonly RemainingPercentage: "remaining_percentage";
1028
+ };
1029
+ /**
1030
+ * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
1031
+ */
1032
+ type ListPlansThresholdType = OpenEnum<typeof ListPlansThresholdType>;
1033
+ type ListPlansUsageAlert = {
1034
+ /**
1035
+ * The feature ID this alert applies to.
1036
+ */
1037
+ featureId?: string | undefined;
1038
+ /**
1039
+ * Whether this usage alert is enabled.
1040
+ */
1041
+ enabled: boolean;
1042
+ /**
1043
+ * The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage_percentage or remaining_percentage, this is a percentage (0-100).
1044
+ */
1045
+ threshold: number;
1046
+ /**
1047
+ * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
1048
+ */
1049
+ thresholdType: ListPlansThresholdType;
1050
+ /**
1051
+ * Optional user-defined label to distinguish multiple alerts on the same feature.
1052
+ */
1053
+ name?: string | undefined;
1054
+ };
1055
+ type ListPlansOverageAllowed = {
1056
+ /**
1057
+ * The feature ID this overage allowed control applies to.
1058
+ */
1059
+ featureId: string;
1060
+ /**
1061
+ * Whether overage is allowed for this feature.
1062
+ */
1063
+ enabled: boolean;
1064
+ };
1065
+ /**
1066
+ * Plan-level billing controls used as customer defaults.
1067
+ */
1068
+ type ListPlansBillingControls = {
1069
+ /**
1070
+ * List of auto top-up configurations per feature.
1071
+ */
1072
+ autoTopups?: Array<ListPlansAutoTopup> | undefined;
1073
+ /**
1074
+ * List of overage spend limits per feature (caps overage spend).
1075
+ */
1076
+ spendLimits?: Array<ListPlansSpendLimit> | undefined;
1077
+ /**
1078
+ * List of hard usage caps per feature (max units per interval).
1079
+ */
1080
+ usageLimits?: Array<ListPlansUsageLimit> | undefined;
1081
+ /**
1082
+ * List of usage alert configurations per feature.
1083
+ */
1084
+ usageAlerts?: Array<ListPlansUsageAlert> | undefined;
1085
+ /**
1086
+ * List of overage allowed controls per feature. When enabled, usage can exceed balance.
1087
+ */
1088
+ overageAllowed?: Array<ListPlansOverageAllowed> | undefined;
1089
+ };
1090
+ /**
1091
+ * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
1092
+ */
1093
+ declare const ListPlansStatus: {
1094
+ readonly Active: "active";
1095
+ readonly Scheduled: "scheduled";
1096
+ };
1097
+ /**
1098
+ * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
1099
+ */
1100
+ type ListPlansStatus = OpenEnum<typeof ListPlansStatus>;
1101
+ /**
1102
+ * The action that would occur if this plan were attached to the customer.
1103
+ */
1104
+ declare const ListPlansAttachAction: {
1105
+ readonly Activate: "activate";
1106
+ readonly Upgrade: "upgrade";
1107
+ readonly Downgrade: "downgrade";
1108
+ readonly None: "none";
1109
+ readonly Purchase: "purchase";
1110
+ };
1111
+ /**
1112
+ * The action that would occur if this plan were attached to the customer.
1113
+ */
1114
+ type ListPlansAttachAction = OpenEnum<typeof ListPlansAttachAction>;
1115
+ type ListPlansCustomerEligibility = {
1116
+ /**
1117
+ * Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
1118
+ */
1119
+ trialAvailable?: boolean | undefined;
1120
+ /**
1121
+ * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
1122
+ */
1123
+ status?: ListPlansStatus | undefined;
1124
+ /**
1125
+ * Whether the customer's active instance of this plan is set to cancel.
1126
+ */
1127
+ canceling?: boolean | undefined;
1128
+ /**
1129
+ * Whether the customer is currently on a free trial of this plan.
1130
+ */
1131
+ trialing?: boolean | undefined;
1132
+ /**
1133
+ * The action that would occur if this plan were attached to the customer.
1134
+ */
1135
+ attachAction: ListPlansAttachAction;
1136
+ };
1137
+ /**
1138
+ * A plan defines a set of features, pricing, and entitlements that can be attached to customers.
1139
+ */
1140
+ type ListPlansList = {
1141
+ /**
1142
+ * Unique identifier for the plan.
1143
+ */
1144
+ id: string;
1145
+ /**
1146
+ * Display name of the plan.
1147
+ */
1148
+ name: string;
1149
+ /**
1150
+ * Optional description of the plan.
1151
+ */
1152
+ description: string | null;
1153
+ /**
1154
+ * Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
1155
+ */
1156
+ group: string | null;
1157
+ /**
1158
+ * Version number of the plan. Incremented when plan configuration changes.
1159
+ */
1160
+ version: number;
1161
+ /**
1162
+ * Whether this is an add-on plan that can be attached alongside a main plan.
1163
+ */
1164
+ addOn: boolean;
1165
+ /**
1166
+ * If true, this plan is automatically attached when a customer is created. Used for free plans.
1167
+ */
1168
+ autoEnable: boolean;
1169
+ /**
1170
+ * Base recurring price for the plan. Null for free plans or usage-only plans.
1171
+ */
1172
+ price: ListPlansPrice | null;
1173
+ /**
1174
+ * Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
1175
+ */
1176
+ items: Array<ListPlansItem>;
1177
+ /**
1178
+ * Free trial configuration. If set, new customers can try this plan before being charged.
1179
+ */
1180
+ freeTrial?: ListPlansFreeTrial | undefined;
1181
+ /**
1182
+ * Unix timestamp (ms) when the plan was created.
1183
+ */
1184
+ createdAt: number;
1185
+ /**
1186
+ * Environment this plan belongs to ('sandbox' or 'live').
1187
+ */
1188
+ env: ListPlansEnv;
1189
+ /**
1190
+ * Whether the plan is archived. Archived plans cannot be attached to new customers.
1191
+ */
1192
+ archived: boolean;
1193
+ /**
1194
+ * Deprecated. Use variant_details.base_plan_id instead. If this is a variant, the ID of the base plan it was created from.
1195
+ */
1196
+ baseVariantId: string | null;
1197
+ /**
1198
+ * Details about how this variant relates to its latest base plan.
1199
+ */
1200
+ variantDetails?: ListPlansVariantDetails | undefined;
1201
+ /**
1202
+ * Miscellaneous plan-level configuration flags.
1203
+ */
1204
+ config: ListPlansConfig;
1205
+ /**
1206
+ * Plan-level billing controls used as customer defaults.
1207
+ */
1208
+ billingControls?: ListPlansBillingControls | undefined;
1209
+ /**
1210
+ * Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
1211
+ */
1212
+ metadata: {
1213
+ [k: string]: any;
1214
+ };
1215
+ customerEligibility?: ListPlansCustomerEligibility | undefined;
1216
+ };
1217
+ /**
1218
+ * OK
1219
+ */
1220
+ type ListPlansResponse = {
1221
+ list: Array<ListPlansList>;
1222
+ };
1223
+
1224
+ export type { ListPlansResponse as L, ListPlansList as a };